diff options
author | scnorton <scnorton@biociphers.org> | 2017-10-16 14:12:59 -0400 |
---|---|---|
committer | scnorton <scnorton@biociphers.org> | 2017-10-16 14:12:59 -0400 |
commit | a6d2bfaebd16940fc0ac1be3ca29caf0888296ca (patch) | |
tree | 7ec979bc8481b2c2d55874aef3e9004ddb715781 /src/engine/name_string_util.c | |
parent | 96ebc5d46287e33df7bda74a6fb340281cdaa4c5 (diff) | |
parent | 7d657ef56716fd01bacf4a47df50ad0ec3d03b10 (diff) |
Merge branch 'master' into secret_base
Diffstat (limited to 'src/engine/name_string_util.c')
-rw-r--r-- | src/engine/name_string_util.c | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/src/engine/name_string_util.c b/src/engine/name_string_util.c new file mode 100644 index 000000000..f1a935453 --- /dev/null +++ b/src/engine/name_string_util.c @@ -0,0 +1,40 @@ +#include "global.h" +#include "name_string_util.h" +#include "string_util.h" +#include "text.h" + +void PadNameString(u8 *a1, u8 a2) +{ + u8 i; + + StripExtCtrlCodes(a1); + i = StringLength(a1); + + if (a2 == 0xFC) + { + while (i < 6) + { + a1[i] = 0xFC; + a1[i + 1] = 7; + i += 2; + } + } + else + { + while (i < 6) + { + a1[i] = a2; + i++; + } + } + + a1[i] = EOS; +} + +void SanitizeNameString(u8 *a1) +{ + if (StringLength(a1) < 6) + ConvertInternationalString(a1, 1); + else + StripExtCtrlCodes(a1); +} |