1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-01-25 01:02:24 +00:00

dupstr() should cope with being passed NULL

[originally from svn r3429]
This commit is contained in:
Jacob Nevins 2003-08-29 22:14:04 +00:00
parent 4eff79612a
commit 0a293ae208

9
misc.c
View File

@ -11,9 +11,12 @@
char *dupstr(const char *s)
{
int len = strlen(s);
char *p = snewn(len + 1, char);
strcpy(p, s);
char *p = NULL;
if (s) {
int len = strlen(s);
p = snewn(len + 1, char);
strcpy(p, s);
}
return p;
}