static int umEncryptString(char_t *textString) { char_t *enMask; char_t enChar; int numChars; a_assert(textString); enMask = UM_XOR_ENCRYPT; numChars = 0; while (*textString) { enChar = *textString ^ *enMask; /* * Do not produce encrypted text with embedded linefeeds or tabs. * Simply use existing character. */ if (enChar && !gisspace(enChar)) *textString = enChar; /* * Increment all pointers. */ enMask++; textString++; numChars++; /* * Wrap encryption mask pointer if at end of length. */ if (*enMask == '\0') { enMask = UM_XOR_ENCRYPT; } } return numChars; }
static char_t *skipWhite(char_t *s) { a_assert(s); if (s == NULL) { return s; } while (*s && gisspace(*s)) { s++; } return s; }
static bool_t umCheckName(char_t *name) { a_assert(name && *name); if (name && *name) { while (*name) { if (gisspace(*name)) { return FALSE; } name++; } return TRUE; } return FALSE; }