| 522 | } |
| 523 | |
| 524 | char *MSG_ReadStringLine( msg_t *msg ) { |
| 525 | static char string[MAX_STRING_CHARS]; |
| 526 | int c; |
| 527 | unsigned int l; |
| 528 | |
| 529 | l = 0; |
| 530 | do { |
| 531 | c = MSG_ReadByte(msg); // use ReadByte so -1 is out of bounds |
| 532 | if (c == -1 || c == 0 || c == '\n') { |
| 533 | break; |
| 534 | } |
| 535 | // translate all fmt spec to avoid crash bugs |
| 536 | if ( c == '%' ) { |
| 537 | c = '.'; |
| 538 | } |
| 539 | string[l] = c; |
| 540 | l++; |
| 541 | } while (l < sizeof(string)-1); |
| 542 | |
| 543 | string[l] = 0; |
| 544 | |
| 545 | return string; |
| 546 | } |
| 547 | |
| 548 | float MSG_ReadAngle16( msg_t *msg ) { |
| 549 | return SHORT2ANGLE(MSG_ReadShort(msg)); |
no test coverage detected