diff options
Diffstat (limited to 'xmalloc.c')
-rw-r--r-- | xmalloc.c | 7 |
1 files changed, 3 insertions, 4 deletions
@@ -13,7 +13,7 @@ | |||
13 | */ | 13 | */ |
14 | 14 | ||
15 | #include "includes.h" | 15 | #include "includes.h" |
16 | RCSID("$OpenBSD: xmalloc.c,v 1.15 2001/04/16 08:05:34 deraadt Exp $"); | 16 | RCSID("$OpenBSD: xmalloc.c,v 1.16 2001/07/23 18:21:46 stevesk Exp $"); |
17 | 17 | ||
18 | #include "xmalloc.h" | 18 | #include "xmalloc.h" |
19 | #include "log.h" | 19 | #include "log.h" |
@@ -58,11 +58,10 @@ xfree(void *ptr) | |||
58 | char * | 58 | char * |
59 | xstrdup(const char *str) | 59 | xstrdup(const char *str) |
60 | { | 60 | { |
61 | size_t len = strlen(str) + 1; | 61 | size_t len; |
62 | char *cp; | 62 | char *cp; |
63 | 63 | ||
64 | if (len == 0) | 64 | len = strlen(str) + 1; |
65 | fatal("xstrdup: zero size"); | ||
66 | cp = xmalloc(len); | 65 | cp = xmalloc(len); |
67 | strlcpy(cp, str, len); | 66 | strlcpy(cp, str, len); |
68 | return cp; | 67 | return cp; |