replace core use of strdup() with dupstr() (trunk only)

This commit is contained in:
nethack.rankin
2012-03-10 02:22:07 +00:00
parent a4cb32e786
commit 78127038a0
3 changed files with 9 additions and 9 deletions

View File

@@ -1020,7 +1020,7 @@ const char* filename;
if (validate(fd, filename)==0) {
char tplname[PL_NSIZ];
get_plname_from_file(fd, tplname);
result = strdup(tplname);
result = dupstr(tplname);
}
(void) close(fd);
}
@@ -1047,7 +1047,7 @@ const char* filename;
for (k=0; name[k]; k++)
if ( name[k]=='_' )
name[k]=' ';
return strdup(name);
return dupstr(name);
} else
# endif /* UNIX && QT_GRAPHICS */
{
@@ -2363,7 +2363,7 @@ int src;
#endif
#ifdef USER_SOUNDS
} else if (match_varname(buf, "SOUNDDIR", 8)) {
sounddir = (char *)strdup(bufp);
sounddir = (char *)dupstr(bufp);
} else if (match_varname(buf, "SOUND", 5)) {
add_sound_mapping(bufp);
#endif
@@ -2372,15 +2372,15 @@ int src;
} else if (match_varname(buf, "QT_TILEWIDTH", 12)) {
extern char *qt_tilewidth;
if (qt_tilewidth == NULL)
qt_tilewidth=(char *)strdup(bufp);
qt_tilewidth=(char *)dupstr(bufp);
} else if (match_varname(buf, "QT_TILEHEIGHT", 13)) {
extern char *qt_tileheight;
if (qt_tileheight == NULL)
qt_tileheight=(char *)strdup(bufp);
qt_tileheight=(char *)dupstr(bufp);
} else if (match_varname(buf, "QT_FONTSIZE", 11)) {
extern char *qt_fontsize;
if (qt_fontsize == NULL)
qt_fontsize=(char *)strdup(bufp);
qt_fontsize=(char *)dupstr(bufp);
} else if (match_varname(buf, "QT_COMPACT", 10)) {
extern int qt_compact_mode;
qt_compact_mode = atoi(bufp);

View File

@@ -1101,7 +1101,7 @@ const char *mapping;
new_map->pattern = (char *)alloc(strlen(text) + 1);
Strcpy(new_map->pattern, text);
#endif
new_map->filename = strdup(filespec);
new_map->filename = dupstr(filespec);
new_map->volume = volume;
new_map->next = soundmap;

View File

@@ -41,8 +41,8 @@ sys_early_init(){
#ifdef PANICTRACE
/* panic options */
sysopt.gdbpath = strdup(GDBPATH);
sysopt.greppath = strdup(GREPPATH);
sysopt.gdbpath = dupstr(GDBPATH);
sysopt.greppath = dupstr(GREPPATH);
# ifdef BETA
sysopt.panictrace_gdb = 1;
# ifdef PANICTRACE_LIBC