char * CleanIGCRecord (char * szIn) { // replace invalid chars w/ 0x20 int iLen = strlen(szIn); for (int i = 0; i < iLen -2; i++) // don't clean terminating \r\n! if (!IsValidIGCChar(szIn[i])) szIn[i]=' '; return szIn; }
/** * @param ignore_comma if true, then the comma is ignored, even though * it's a valid IGC character */ static void AppendIGCString(MD5 &md5, const char *s, bool ignore_comma) { while (*s != '\0') { const char ch = *s++; if (ignore_comma && ch == ',') continue; if (IsValidIGCChar(ch)) md5.Append(ch); } }
char * CopyIGCString(char *dest, char *dest_limit, const TCHAR *src) { assert(dest != nullptr); assert(dest_limit > dest); assert(src != nullptr); while (*src != '\0') { TCHAR ch = *src++; if (IsValidIGCChar(ch)) { *dest++ = ch; if (dest == dest_limit) break; } } return dest; }