- unsigned size = countValuePairs(pairs);
- STG_PAIR* res = new STG_PAIR[size + 1];
- size_t pos = 0;
- while (pairs != NULL) {
- bzero(res[pos].key, sizeof(STG_PAIR::key));
- bzero(res[pos].value, sizeof(STG_PAIR::value));
- strncpy(res[pos].key, pairs->name, sizeof(STG_PAIR::key));
- strncpy(res[pos].value, pairs->data.strvalue, sizeof(STG_PAIR::value));
- ++pos;
- pairs = pairs->next;
- }
- bzero(res[pos].key, sizeof(STG_PAIR::key));
- bzero(res[pos].value, sizeof(STG_PAIR::value));
- return res;
+ return stgRequest(STG_CLIENT::PRE_ACCT, userName, password, pairs);