Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int gg_parselink_getuin(char *arg)
- {
- char *num_table = "1234567890";
- char *tmp = NULL;
- char *token = NULL;
- int parse_start, parse_length = 0;
- // remember - put checks what to do when number is not found, with strcspn & strspn, etc
- // token link
- // here will be first trying to get uin from token
- //MessageBox(NULL, arg,"Testing Window ARG",MB_OK | MB_ICONWARNING | MB_SETFOREGROUND | MB_TOPMOST);
- token = strtok (arg, "?&");
- while (token != NULL)
- {
- // MessageBox(NULL, token,"Testing Window TOKEN",MB_OK | MB_ICONWARNING | MB_SETFOREGROUND | MB_TOPMOST);
- tmp = strstr(token, "ggid=");
- if (tmp != NULL)
- {
- // MessageBox(NULL, tmp,"Testing Window TMP",MB_OK | MB_ICONWARNING | MB_SETFOREGROUND | MB_TOPMOST);
- parse_length = strspn(arg + *tmp + 5, num_table);
- strncpy (tmp, arg + *tmp + 5, parse_length);
- return atoi(tmp);
- }
- token = strtok (NULL, "?&");
- }
- // otherwise get first number found in link
- parse_start = strcspn(arg, num_table);
- parse_length = strspn(arg + parse_start, num_table);
- strncpy(tmp, arg + parse_start, parse_length);
- tmp[parse_length] = '\0';
- return atoi(tmp);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement