… | |
… | |
425 | while (1) |
425 | while (1) |
426 | { |
426 | { |
427 | /* 1. Extract an info */ |
427 | /* 1. Extract an info */ |
428 | info = nextinfo; |
428 | info = nextinfo; |
429 | |
429 | |
430 | while ((info < len) && (buf[info] == ' ')) |
430 | while ((info < len) && (buf [info] == ' ')) |
431 | info++; |
431 | info++; |
432 | |
432 | |
433 | if (info >= len) |
433 | if (info >= len) |
434 | break; |
434 | break; |
435 | |
435 | |
436 | nextinfo = info + 1; |
436 | nextinfo = info + 1; |
437 | |
437 | |
438 | while ((nextinfo < len) && (buf[nextinfo] != ' ')) |
438 | while ((nextinfo < len) && (buf [nextinfo] != ' ')) |
439 | nextinfo++; |
439 | nextinfo++; |
440 | |
440 | |
441 | if (nextinfo - info >= 49) /*Erroneous info asked */ |
441 | if (nextinfo - info >= 49) /*Erroneous info asked */ |
442 | continue; |
442 | continue; |
443 | |
443 | |
444 | strncpy (command, &(buf[info]), nextinfo - info); |
444 | memcpy (command, buf + info, nextinfo - info); |
445 | command[nextinfo - info] = '\0'; |
445 | command [nextinfo - info] = 0; |
|
|
446 | |
446 | /* 2. Interpret info */ |
447 | /* 2. Interpret info */ |
447 | i = sscanf (command, "%d", &flag); |
448 | i = sscanf (command, "%d", &flag); |
448 | |
449 | |
449 | if ((i == 1) && (flag > 0) && (flag <= MSG_TYPE_LAST)) |
450 | if ((i == 1) && (flag > 0) && (flag <= MSG_TYPE_LAST)) |
450 | ns->supported_readables |= (1 << flag); |
451 | ns->supported_readables |= (1 << flag); |
… | |
… | |
484 | return; |
485 | return; |
485 | |
486 | |
486 | buf++; |
487 | buf++; |
487 | } |
488 | } |
488 | |
489 | |
489 | execute_newserver_command (pl->ob, (char *) buf); |
490 | execute_newserver_command (pl->ob, (char *)buf); |
490 | |
491 | |
491 | /* Perhaps something better should be done with a left over count. |
492 | /* Perhaps something better should be done with a left over count. |
492 | * Cleaning up the input should probably be done first - all actions |
493 | * Cleaning up the input should probably be done first - all actions |
493 | * for the command that issued the count should be done before any other |
494 | * for the command that issued the count should be done before any other |
494 | * commands. |
495 | * commands. |