~mdw
/
sgt
/
putty
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
e658223
)
dupstr() should cope with being passed NULL
author
jacob
<jacob@cda61777-01e9-0310-a592-d414129be87e>
Fri, 29 Aug 2003 22:14:04 +0000
(22:14 +0000)
committer
jacob
<jacob@cda61777-01e9-0310-a592-d414129be87e>
Fri, 29 Aug 2003 22:14:04 +0000
(22:14 +0000)
git-svn-id: svn://svn.tartarus.org/sgt/putty@3429
cda61777
-01e9-0310-a592-
d414129be87e
misc.c
patch
|
blob
|
blame
|
history
diff --git
a/misc.c
b/misc.c
index
3fea374
..
78d829a
100644
(file)
--- a/
misc.c
+++ b/
misc.c
@@
-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;
}