Remove superfluous mystrdup() code.
authorDavid Griffith <dave@661.org>
Tue, 24 Sep 2019 07:27:39 +0000 (00:27 -0700)
committerDavid Griffith <dave@661.org>
Tue, 24 Sep 2019 07:27:39 +0000 (00:27 -0700)
src/sdl/sf_util.c

index 8e73f333da351d3064d0e3c717465754438b81b8..ee7691996dcf4fbb918c9c6adcc6e970eb091b99 100644 (file)
@@ -792,48 +792,8 @@ static int dialog_read_file_name(char *file_name, const char *default_name,
        return 0;
 }
 
-
-typedef struct {
-       void *link;
-       char *str;
-} Dynstr;
-
-static Dynstr *strings = NULL;
-
-static void freestrings()
-{
-       while (strings) {
-               Dynstr *r = strings->link;
-               if (strings->str)
-                       free(strings->str);
-               free(strings);
-               strings = r;
-       }
-}
-
-
-static char *mystrdup(char *p)
-{
-       Dynstr *r;
-       if (!p)
-               return p;
-       p = strdup(p);
-       if (!p)
-               return p;
-       r = calloc(1, sizeof(Dynstr));
-       if (r) {
-               if (!strings)
-                       CLEANREG(freestrings);
-               r->link = strings;
-               r->str = p;
-               strings = r;
-       }
-       return p;
-}
-
 static char *rc = NULL;
 
-
 void sf_FinishProfile()
 {
 //printf("finishprofile\n");
@@ -1009,7 +969,7 @@ char *sf_GetProfileString(const char *sect, const char *id, char *def)
                }
        }
        if (def)
-               def = mystrdup(def);
+               def = strdup(def);
        if (sav)
                *q = sav;
        return def;