MCPcopy Create free account
hub / github.com/assaultcube/AC / filtercountrycode

Function filtercountrycode

source/src/protocol.cpp:475–484  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

473}
474
475void filtercountrycode(char *d, const char *s) // returns exactly two uppercase chars or "--"
476{
477 d[0] = d[1] = '-';
478 d[2] = '\0';
479 if(isalpha(s[0]) && isalpha(s[1]) && !s[2])
480 {
481 d[0] = toupper(s[0]);
482 d[1] = toupper(s[1]);
483 }
484}
485
486void trimtrailingwhitespace(char *s)
487{

Callers 3

parsevitasFunction · 0.85
parsemessagesFunction · 0.85
serversliceFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected