From dc789353fd0c1fe9b896623ce10c0c8d50db7f9c Mon Sep 17 00:00:00 2001 From: Stanislav Gromov Date: Sun, 15 Nov 2020 02:23:42 +0700 Subject: [PATCH] Use `duplicatestring()` instead of `strdup()` --- source/compiler/sc1.c | 2 +- source/compiler/sc2.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/source/compiler/sc1.c b/source/compiler/sc1.c index ca0a1c4..b7fc74f 100644 --- a/source/compiler/sc1.c +++ b/source/compiler/sc1.c @@ -8365,7 +8365,7 @@ static void dopragma(void) * and parse the argument(s), if needed */ if (!strcmp(str,"deprecated")) { free(pc_deprecate); - pc_deprecate=strdup(&str[i]); + pc_deprecate=duplicatestring(&str[i]); if (pc_deprecate==NULL) error(103); /* insufficient memory */ pc_attributes |= (1U << attrDEPRECATED); diff --git a/source/compiler/sc2.c b/source/compiler/sc2.c index fdb2df9..cac5fbc 100644 --- a/source/compiler/sc2.c +++ b/source/compiler/sc2.c @@ -1010,7 +1010,7 @@ static const unsigned char *getstring(unsigned char *dest,int max,const unsigned */ static char* strdupwithouta(const char* sourcestring) { - char* result=strdup(sourcestring); + char* result=duplicatestring(sourcestring); char* a=result; if (result==NULL) { return NULL;