MCPcopy Create free account
hub / github.com/JACoders/OpenJK / MSG_ReadStringLine

Function MSG_ReadStringLine

codemp/qcommon/msg.cpp:524–546  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

522}
523
524char *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
548float MSG_ReadAngle16( msg_t *msg ) {
549 return SHORT2ANGLE(MSG_ReadShort(msg));

Callers 3

CL_ConnectionlessPacketFunction · 0.50
CL_ServerStatusResponseFunction · 0.50
SV_ConnectionlessPacketFunction · 0.50

Calls 1

MSG_ReadByteFunction · 0.70

Tested by

no test coverage detected