summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorstevesk <stevesk@openbsd.org>2001-07-23 18:21:46 +0000
committerstevesk <stevesk@openbsd.org>2001-07-23 18:21:46 +0000
commit0b3d76e4ea64abfb92232ed904a8025e8498ffcb (patch)
treec070bd12fbba8269edfb50ca3e7261ca07128cb1
parentuse %lu; ok markus@ (diff)
downloadwireguard-openbsd-0b3d76e4ea64abfb92232ed904a8025e8498ffcb.tar.xz
wireguard-openbsd-0b3d76e4ea64abfb92232ed904a8025e8498ffcb.zip
no zero size xstrdup() error; ok markus@
-rw-r--r--usr.bin/ssh/xmalloc.c7
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;