diff options
author | itojun <> | 2003-03-04 00:29:17 +0000 |
---|---|---|
committer | itojun <> | 2003-03-04 00:29:17 +0000 |
commit | 81f5994daeaee763274ed3a99805c77e55b46a6d (patch) | |
tree | f9be9b5430f88e19b76736abb4020b24219b9dff /src/lib/libc/net/res_debug.c | |
parent | 9464e28cab6e9f9e7df083a4bcef97ec8b721535 (diff) | |
download | openbsd-81f5994daeaee763274ed3a99805c77e55b46a6d.tar.gz openbsd-81f5994daeaee763274ed3a99805c77e55b46a6d.tar.bz2 openbsd-81f5994daeaee763274ed3a99805c77e55b46a6d.zip |
strlcpy, check retval from sprintf
Diffstat (limited to 'src/lib/libc/net/res_debug.c')
-rw-r--r-- | src/lib/libc/net/res_debug.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/lib/libc/net/res_debug.c b/src/lib/libc/net/res_debug.c index f4e4c271ed..b39e9a3b14 100644 --- a/src/lib/libc/net/res_debug.c +++ b/src/lib/libc/net/res_debug.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: res_debug.c,v 1.15 2003/01/28 04:58:00 marc Exp $ */ | 1 | /* $OpenBSD: res_debug.c,v 1.16 2003/03/04 00:29:17 itojun Exp $ */ |
2 | 2 | ||
3 | /* | 3 | /* |
4 | * ++Copyright++ 1985, 1990, 1993 | 4 | * ++Copyright++ 1985, 1990, 1993 |
@@ -82,7 +82,7 @@ | |||
82 | static char sccsid[] = "@(#)res_debug.c 8.1 (Berkeley) 6/4/93"; | 82 | static char sccsid[] = "@(#)res_debug.c 8.1 (Berkeley) 6/4/93"; |
83 | static char rcsid[] = "$From: res_debug.c,v 8.19 1996/11/26 10:11:23 vixie Exp $"; | 83 | static char rcsid[] = "$From: res_debug.c,v 8.19 1996/11/26 10:11:23 vixie Exp $"; |
84 | #else | 84 | #else |
85 | static char rcsid[] = "$OpenBSD: res_debug.c,v 1.15 2003/01/28 04:58:00 marc Exp $"; | 85 | static char rcsid[] = "$OpenBSD: res_debug.c,v 1.16 2003/03/04 00:29:17 itojun Exp $"; |
86 | #endif | 86 | #endif |
87 | #endif /* LIBC_SCCS and not lint */ | 87 | #endif /* LIBC_SCCS and not lint */ |
88 | 88 | ||
@@ -448,10 +448,10 @@ __p_fqnname(cp, msg, msglen, name, namelen) | |||
448 | return (NULL); | 448 | return (NULL); |
449 | newlen = strlen(name); | 449 | newlen = strlen(name); |
450 | if (newlen == 0 || name[newlen - 1] != '.') { | 450 | if (newlen == 0 || name[newlen - 1] != '.') { |
451 | if (newlen+1 >= namelen) /* Lack space for final dot */ | 451 | if (newlen + 1 >= namelen) /* Lack space for final dot */ |
452 | return (NULL); | 452 | return (NULL); |
453 | else | 453 | else |
454 | strcpy(name + newlen, "."); | 454 | strlcpy(name + newlen, ".", namelen - newlen); |
455 | } | 455 | } |
456 | return (cp + n); | 456 | return (cp + n); |
457 | } | 457 | } |