diff options
author | Kevin Steves <stevesk@cvs.openbsd.org> | 2001-07-23 18:21:47 +0000 |
---|---|---|
committer | Kevin Steves <stevesk@cvs.openbsd.org> | 2001-07-23 18:21:47 +0000 |
commit | 65420aa942908cf72b418b15fecdda7e1b7297a7 (patch) | |
tree | 5c17ba6690707385c23601ca6482cf2df3f40fc1 | |
parent | ebbfd4e6fba85b79a1a296058cb494d1442f37a4 (diff) |
no zero size xstrdup() error; ok markus@
-rw-r--r-- | usr.bin/ssh/xmalloc.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/usr.bin/ssh/xmalloc.c b/usr.bin/ssh/xmalloc.c index 50466274907..99c6ac3301a 100644 --- a/usr.bin/ssh/xmalloc.c +++ b/usr.bin/ssh/xmalloc.c @@ -13,7 +13,7 @@ */ #include "includes.h" -RCSID("$OpenBSD: xmalloc.c,v 1.15 2001/04/16 08:05:34 deraadt Exp $"); +RCSID("$OpenBSD: xmalloc.c,v 1.16 2001/07/23 18:21:46 stevesk Exp $"); #include "xmalloc.h" #include "log.h" @@ -58,11 +58,10 @@ xfree(void *ptr) char * xstrdup(const char *str) { - size_t len = strlen(str) + 1; + size_t len; char *cp; - if (len == 0) - fatal("xstrdup: zero size"); + len = strlen(str) + 1; cp = xmalloc(len); strlcpy(cp, str, len); return cp; |