diff options
author | Jun-ichiro itojun Hagino <itojun@cvs.openbsd.org> | 2003-03-04 00:29:18 +0000 |
---|---|---|
committer | Jun-ichiro itojun Hagino <itojun@cvs.openbsd.org> | 2003-03-04 00:29:18 +0000 |
commit | 798906b736c5b108d3db2cb493e03a474c6cc059 (patch) | |
tree | 3405246fba7774d279c3cf33f29686575de27ae7 /lib/libc/net/res_debug.c | |
parent | 11c9efbb72c43c56f695bc0936a159533cf6a8e8 (diff) |
strlcpy, check retval from sprintf
Diffstat (limited to 'lib/libc/net/res_debug.c')
-rw-r--r-- | lib/libc/net/res_debug.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/libc/net/res_debug.c b/lib/libc/net/res_debug.c index f4e4c271ed2..b39e9a3b14f 100644 --- a/lib/libc/net/res_debug.c +++ b/lib/libc/net/res_debug.c @@ -1,4 +1,4 @@ -/* $OpenBSD: res_debug.c,v 1.15 2003/01/28 04:58:00 marc Exp $ */ +/* $OpenBSD: res_debug.c,v 1.16 2003/03/04 00:29:17 itojun Exp $ */ /* * ++Copyright++ 1985, 1990, 1993 @@ -82,7 +82,7 @@ static char sccsid[] = "@(#)res_debug.c 8.1 (Berkeley) 6/4/93"; static char rcsid[] = "$From: res_debug.c,v 8.19 1996/11/26 10:11:23 vixie Exp $"; #else -static char rcsid[] = "$OpenBSD: res_debug.c,v 1.15 2003/01/28 04:58:00 marc Exp $"; +static char rcsid[] = "$OpenBSD: res_debug.c,v 1.16 2003/03/04 00:29:17 itojun Exp $"; #endif #endif /* LIBC_SCCS and not lint */ @@ -448,10 +448,10 @@ __p_fqnname(cp, msg, msglen, name, namelen) return (NULL); newlen = strlen(name); if (newlen == 0 || name[newlen - 1] != '.') { - if (newlen+1 >= namelen) /* Lack space for final dot */ + if (newlen + 1 >= namelen) /* Lack space for final dot */ return (NULL); else - strcpy(name + newlen, "."); + strlcpy(name + newlen, ".", namelen - newlen); } return (cp + n); } |