summaryrefslogtreecommitdiff
path: root/usr.sbin/rbootd/utils.c
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2002-05-29 18:39:01 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2002-05-29 18:39:01 +0000
commitda4b035c00c91f83f53006859ff51cc6316c59fd (patch)
tree5b71ada85fe1e39d042db8b6a28ab5ba06a71408 /usr.sbin/rbootd/utils.c
parent8852a4e96620349bdbb8b1910914433eb4ae5b23 (diff)
more strlcat and strlcpy
Diffstat (limited to 'usr.sbin/rbootd/utils.c')
-rw-r--r--usr.sbin/rbootd/utils.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/usr.sbin/rbootd/utils.c b/usr.sbin/rbootd/utils.c
index ad8c0d14c18..327073f7e45 100644
--- a/usr.sbin/rbootd/utils.c
+++ b/usr.sbin/rbootd/utils.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: utils.c,v 1.5 2002/03/14 16:44:25 mpech Exp $ */
+/* $OpenBSD: utils.c,v 1.6 2002/05/29 18:39:00 deraadt Exp $ */
/* $NetBSD: utils.c,v 1.5.2.1 1995/11/14 08:45:46 thorpej Exp $ */
/*
@@ -49,7 +49,7 @@
#ifndef lint
/*static char sccsid[] = "@(#)utils.c 8.1 (Berkeley) 6/4/93";*/
-static char rcsid[] = "$OpenBSD: utils.c,v 1.5 2002/03/14 16:44:25 mpech Exp $";
+static char rcsid[] = "$OpenBSD: utils.c,v 1.6 2002/05/29 18:39:00 deraadt Exp $";
#endif /* not lint */
#include <sys/param.h>
@@ -338,12 +338,11 @@ NewStr(str)
{
char *stmp;
- if ((stmp = (char *)malloc((unsigned) (strlen(str)+1))) == NULL) {
+ stmp = strdup(str);
+ if (stmp == NULL) {
syslog(LOG_ERR, "NewStr: out of memory (%s)", str);
return(NULL);
}
-
- (void) strcpy(stmp, str);
return(stmp);
}