commit e618f6c6568954f2f60dde308d4b57914d0038ba
parent 819b95b112acdfa62ca898c10c03ebcaf4e6d381
Author: vx_clutch <[email protected]>
Date: Mon, 29 Sep 2025 11:40:17 -0400
Update util.c
Diffstat:
1 file changed, 11 insertions(+), 20 deletions(-)
diff --git 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,