diff --git a/src/util.c b/src/util.c index ed2808d..5f11ad6 100644 --- a/src/util.c +++ b/src/util.c @@ -18,6 +18,17 @@ int fno = 1; bool flast = false; +char *tostrupr(const char *s) +{ + char *new = malloc(strlen(s) + 1); + if (!new) + return NULL; + strcpy(new, s); + for (int i = 0; new[i] != '\0'; ++i) + new[i] = toupper((unsigned char)new[i]); + return new; +} + licence_t TOlicence(char *src) { char *s = tostrupr(src); @@ -31,26 +42,6 @@ licence_t TOlicence(char *src) return BSD; } -char *str_dup(const char *s) -{ - char *new = malloc(strlen(s) + 1); - if (!new) - return NULL; - strcpy(new, s); - return new; -} - -char *tostrupr(const char *s) -{ - char *new = malloc(strlen(s) + 1); - if (!new) - return NULL; - strcpy(new, s); - for (int i = 0; new[i] != '\0'; ++i) - new[i] = toupper((unsigned char)new[i]); - return new; -} - static char *nextchar; int getopt_long(int argc, char *const argv[], const char *optstring,