fixed problem which could result in strdup(NULL)

CVS patchset: 252
CVS date: 1996/01/30 04:12:58
This commit is contained in:
ewt 1996-01-30 04:12:58 +00:00
parent 881145f547
commit 5764e29cdc
1 changed files with 5 additions and 1 deletions

View File

@ -21,5 +21,9 @@ void setVar(int var, char *val)
return ; /* XXX should we go harey carey here? */
if (values[var]) free(values[var]);
values[var] = strdup(val);
if (val)
values[var] = strdup(val);
else
values[var] = NULL;
}