summaryrefslogtreecommitdiff
path: root/src/engine/name_string_util.c
diff options
context:
space:
mode:
authorcamthesaxman <cameronghall@cox.net>2017-11-08 17:25:26 -0600
committercamthesaxman <cameronghall@cox.net>2017-11-08 17:25:26 -0600
commitfc11078cef11edc9deedd08c6175fb5e6628504c (patch)
tree62823b5dc1335a4d8659104dc4156713674ce757 /src/engine/name_string_util.c
parentba06c424c974f18f9c4af85eb0ffe8adc6056941 (diff)
parent8832b766facd48c85c1b99ac6dad555f1e2aa1c7 (diff)
fix merge conflicts
Diffstat (limited to 'src/engine/name_string_util.c')
-rw-r--r--src/engine/name_string_util.c40
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);
+}