| 493 | } |
| 494 | |
| 495 | const char *GetWordNum(int num, const char *l_String) { |
| 496 | static char strreturn[600]; |
| 497 | static char ptokstr[600]; |
| 498 | char seps[10] = " \n\r\t"; |
| 499 | char *token, *strstart; |
| 500 | |
| 501 | strstart = ptokstr; |
| 502 | |
| 503 | strcpy(ptokstr, l_String); |
| 504 | |
| 505 | token = strtok(ptokstr, seps); |
| 506 | |
| 507 | for (int i = 0; i != num; i++) { |
| 508 | token = strtok(nullptr, seps); |
| 509 | } |
| 510 | if (token) { |
| 511 | strcpy(strreturn, token); |
| 512 | } else { |
| 513 | return ""; |
| 514 | } |
| 515 | // check for the ':' char.... |
| 516 | if (token[0] == ':') { |
| 517 | // Its not pretty, but it works, return the rest of the string |
| 518 | strcpy(strreturn, l_String + ((token - strstart) + 1)); |
| 519 | } |
| 520 | |
| 521 | // return the appropriate response. |
| 522 | return strreturn; |
| 523 | } |
| 524 | |
| 525 | int AddChatUser(const char *nickname) { |
| 526 | Curruser = Firstuser; |
no outgoing calls
no test coverage detected