more dupstr (trunk only)
This commit is contained in:
@@ -2363,7 +2363,7 @@ int src;
|
||||
#endif
|
||||
#ifdef USER_SOUNDS
|
||||
} else if (match_varname(buf, "SOUNDDIR", 8)) {
|
||||
sounddir = (char *)dupstr(bufp);
|
||||
sounddir = 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 *)dupstr(bufp);
|
||||
qt_tilewidth = dupstr(bufp);
|
||||
} else if (match_varname(buf, "QT_TILEHEIGHT", 13)) {
|
||||
extern char *qt_tileheight;
|
||||
if (qt_tileheight == NULL)
|
||||
qt_tileheight=(char *)dupstr(bufp);
|
||||
qt_tileheight = dupstr(bufp);
|
||||
} else if (match_varname(buf, "QT_FONTSIZE", 11)) {
|
||||
extern char *qt_fontsize;
|
||||
if (qt_fontsize == NULL)
|
||||
qt_fontsize=(char *)dupstr(bufp);
|
||||
qt_fontsize = dupstr(bufp);
|
||||
} else if (match_varname(buf, "QT_COMPACT", 10)) {
|
||||
extern int qt_compact_mode;
|
||||
qt_compact_mode = atoi(bufp);
|
||||
|
||||
@@ -172,12 +172,9 @@ new_omailcmd(otmp, response_cmd)
|
||||
struct obj *otmp;
|
||||
const char *response_cmd;
|
||||
{
|
||||
unsigned lth = strlen(response_cmd) + 1;
|
||||
|
||||
if (!otmp->oextra) otmp->oextra = newoextra();
|
||||
if (OMAILCMD(otmp)) free_omailcmd(otmp);
|
||||
OMAILCMD(otmp) = (char *)alloc(lth);
|
||||
Strcpy(OMAILCMD(otmp), response_cmd);
|
||||
OMAILCMD(otmp) = dupstr(response_cmd);
|
||||
}
|
||||
|
||||
void
|
||||
|
||||
@@ -1383,11 +1383,8 @@ struct monst *mtmp2, *mtmp1;
|
||||
|
||||
if (!mtmp2->mextra) mtmp2->mextra = newmextra();
|
||||
if (MNAME(mtmp1)) {
|
||||
int lth = strlen(MNAME(mtmp1)) + 1;
|
||||
if (lth) {
|
||||
new_mname(mtmp2, lth);
|
||||
Strcpy(MNAME(mtmp2), MNAME(mtmp1));
|
||||
}
|
||||
new_mname(mtmp2, (int)strlen(MNAME(mtmp1)) + 1);
|
||||
Strcpy(MNAME(mtmp2), MNAME(mtmp1));
|
||||
}
|
||||
if (EGD(mtmp1)) {
|
||||
if (!EGD(mtmp2)) newegd(mtmp2);
|
||||
|
||||
12
src/region.c
12
src/region.c
@@ -796,14 +796,10 @@ const char *msg_leave;
|
||||
NhRect tmprect;
|
||||
NhRegion *reg = create_region((NhRect *) 0, 0);
|
||||
|
||||
if (msg_enter) {
|
||||
reg->enter_msg = (const char *) alloc(strlen(msg_enter) + 1);
|
||||
Strcpy(reg->enter_msg, msg_enter);
|
||||
}
|
||||
if (msg_leave) {
|
||||
reg->leave_msg = (const char *) alloc(strlen(msg_leave) + 1);
|
||||
Strcpy(reg->leave_msg, msg_leave);
|
||||
}
|
||||
if (msg_enter)
|
||||
reg->enter_msg = dupstr(msg_enter);
|
||||
if (msg_leave)
|
||||
reg->leave_msg = dupstr(msg_leave);
|
||||
tmprect.lx = x;
|
||||
tmprect.ly = y;
|
||||
tmprect.hx = x + w;
|
||||
|
||||
@@ -96,10 +96,8 @@ time_t when;
|
||||
int line;
|
||||
|
||||
rip = dp = (char **) alloc(sizeof(rip_txt));
|
||||
for (x = 0; rip_txt[x]; x++) {
|
||||
dp[x] = (char *) alloc((unsigned int)(strlen(rip_txt[x]) + 1));
|
||||
Strcpy(dp[x], rip_txt[x]);
|
||||
}
|
||||
for (x = 0; rip_txt[x]; ++x)
|
||||
dp[x] = dupstr(rip_txt[x]);
|
||||
dp[x] = (char *)0;
|
||||
|
||||
/* Put name on stone */
|
||||
|
||||
@@ -1098,8 +1098,7 @@ const char *mapping;
|
||||
new_map->regex.allocated = 0;
|
||||
new_map->regex.regs_allocated = REGS_FIXED;
|
||||
#else
|
||||
new_map->pattern = (char *)alloc(strlen(text) + 1);
|
||||
Strcpy(new_map->pattern, text);
|
||||
new_map->pattern = dupstr(text);
|
||||
#endif
|
||||
new_map->filename = dupstr(filespec);
|
||||
new_map->volume = volume;
|
||||
|
||||
Reference in New Issue
Block a user