added function to convert string to all uppercase characters
[rocksndiamonds.git] / src / libgame / misc.c
index c84cefc01034734b61a72fe7f468c50b03b08f56..5fd8e3c20966170bb3a71d3e60ad11274271a022 100644 (file)
@@ -1220,6 +1220,18 @@ char *getStringCopyNStatic(const char *s, int n)
   return s_copy;
 }
 
+char *getStringToUpper(const char *s)
+{
+  char *s_copy = checked_malloc(strlen(s) + 1);
+  char *s_ptr = s_copy;
+
+  while (*s)
+    *s_ptr++ = toupper(*s++);
+  *s_ptr = '\0';
+
+  return s_copy;
+}
+
 char *getStringToLower(const char *s)
 {
   char *s_copy = checked_malloc(strlen(s) + 1);