Import OpenBSD cvs as of roughly 11:11 UTC today,

or CTM delta 3188/3189/3190.
This commit is contained in:
tg
2003-04-10 13:54:46 +00:00
parent a34b05d2e6
commit 485fcb1158
3 changed files with 18 additions and 7 deletions

14
misc.c
View File

@ -1,4 +1,4 @@
/* $OpenBSD: misc.c,v 1.14 2003/03/13 09:03:07 deraadt Exp $ */
/* $OpenBSD: misc.c,v 1.15 2003/04/04 23:12:02 deraadt Exp $ */
/*
* Miscellaneous functions
@ -83,7 +83,17 @@ str_save(s, ap)
register const char *s;
Area *ap;
{
return s ? strcpy((char*) alloc((size_t)strlen(s)+1, ap), s) : NULL;
size_t len;
char *p;
if (!s)
return NULL;
len = strlen(s)+1;
p = alloc(len, ap);
if (!p)
return NULL;
strlcpy(p, s, len+1);
return (p);
}
/* Allocate a string of size n+1 and copy upto n characters from the possibly