Skip to content

Commit

Permalink
Replace strdup() with M_StringDuplicate() (#86)
Browse files Browse the repository at this point in the history
  • Loading branch information
erysdren authored Aug 28, 2024
1 parent dbf4eed commit 9c4a0f7
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions rott/rt_cfg.c
Original file line number Diff line number Diff line change
Expand Up @@ -1851,7 +1851,7 @@ void GetAlternatePath (char * tokenstr, AlternateInformation *info)
if (!stricmp (token, tokenstr))
{
GetTokenEOL (false);
info->path = strdup(name);
info->path = M_StringDuplicate(name);
}
}

Expand All @@ -1877,7 +1877,7 @@ void GetAlternateFile (char * tokenstr, AlternateInformation *info)
{
#if (SHAREWARE == 0)
info->avail = true;
info->file = strdup(token);
info->file = M_StringDuplicate(token);
#else
printf("Alternate file %s ignored.\n",token);
info->file = "";
Expand Down
6 changes: 3 additions & 3 deletions rott/rt_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -733,7 +733,7 @@ void SetupWads( void )
}else{
fread(buf,3,3,f);//is the 3 first letters RTL (RTC)
if (((strstr(buf,"RTL") != 0)||strstr(buf,"RTC") != 0)) {
GameLevels.file = strdup(tempstr);
GameLevels.file = M_StringDuplicate(tempstr);
GameLevels.avail++;
buf = safe_realloc(buf, 32 + strlen(tempstr));
strcpy (buf,"Adding ");
Expand Down Expand Up @@ -772,7 +772,7 @@ NoRTL:;
}else{
fread(buf,3,3,f);//is the 3 first letters RTL (RTC)
if (((strstr(buf,"RTL") != 0)||strstr(buf,"RTC") != 0)) {
BattleLevels.file = strdup(tempstr);
BattleLevels.file = M_StringDuplicate(tempstr);
BattleLevels.avail++;
buf = safe_realloc(buf, 32 + strlen(tempstr));
strcpy (buf,"Adding ");
Expand Down Expand Up @@ -836,7 +836,7 @@ NoRTC:;
if (*src != '\\')
strcat (tempstr,"\\\0");
strcat (tempstr,RemoteSounds.file);
newargs [argnum++] = strdup(tempstr);
newargs [argnum++] = M_StringDuplicate(tempstr);
}
else
{
Expand Down
2 changes: 1 addition & 1 deletion rott/rt_ted.c
Original file line number Diff line number Diff line change
Expand Up @@ -1648,7 +1648,7 @@ void GetMapFileName ( char * filename, size_t n )
void SetBattleMapFileName ( char * filename )
{
BattleLevels.avail = true;
BattleLevels.file = strdup(filename);
BattleLevels.file = M_StringDuplicate(filename);
}

/*
Expand Down

0 comments on commit 9c4a0f7

Please sign in to comment.