diff options
| author | lebel <> | 2001-06-27 00:58:56 +0000 |
|---|---|---|
| committer | lebel <> | 2001-06-27 00:58:56 +0000 |
| commit | ba6f70d7550cc513151c4bb719659d4775a9efff (patch) | |
| tree | 267e8c115af6744d1fab5a015c06458ba2befdab /src/lib/libc/net/res_query.c | |
| parent | c18bed276b8f6877a6111a6c03185f0025220031 (diff) | |
| download | openbsd-ba6f70d7550cc513151c4bb719659d4775a9efff.tar.gz openbsd-ba6f70d7550cc513151c4bb719659d4775a9efff.tar.bz2 openbsd-ba6f70d7550cc513151c4bb719659d4775a9efff.zip | |
use strlcpy vs strncpy+a[len-1]='\0'. millert@ ok.
Diffstat (limited to 'src/lib/libc/net/res_query.c')
| -rw-r--r-- | src/lib/libc/net/res_query.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/lib/libc/net/res_query.c b/src/lib/libc/net/res_query.c index 433e80f648..db76821fc6 100644 --- a/src/lib/libc/net/res_query.c +++ b/src/lib/libc/net/res_query.c | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | /* $OpenBSD: res_query.c,v 1.14 2001/06/11 10:06:01 itojun Exp $ */ | 1 | /* $OpenBSD: res_query.c,v 1.15 2001/06/27 00:58:55 lebel Exp $ */ |
| 2 | 2 | ||
| 3 | /* | 3 | /* |
| 4 | * ++Copyright++ 1988, 1993 | 4 | * ++Copyright++ 1988, 1993 |
| @@ -60,7 +60,7 @@ | |||
| 60 | static char sccsid[] = "@(#)res_query.c 8.1 (Berkeley) 6/4/93"; | 60 | static char sccsid[] = "@(#)res_query.c 8.1 (Berkeley) 6/4/93"; |
| 61 | static char rcsid[] = "$From: res_query.c,v 8.9 1996/09/22 00:13:28 vixie Exp $"; | 61 | static char rcsid[] = "$From: res_query.c,v 8.9 1996/09/22 00:13:28 vixie Exp $"; |
| 62 | #else | 62 | #else |
| 63 | static char rcsid[] = "$OpenBSD: res_query.c,v 1.14 2001/06/11 10:06:01 itojun Exp $"; | 63 | static char rcsid[] = "$OpenBSD: res_query.c,v 1.15 2001/06/27 00:58:55 lebel Exp $"; |
| 64 | #endif | 64 | #endif |
| 65 | #endif /* LIBC_SCCS and not lint */ | 65 | #endif /* LIBC_SCCS and not lint */ |
| 66 | 66 | ||
| @@ -390,8 +390,8 @@ hostalias(name) | |||
| 390 | break; | 390 | break; |
| 391 | for (cp2 = cp1 + 1; *cp2 && !isspace(*cp2); ++cp2) | 391 | for (cp2 = cp1 + 1; *cp2 && !isspace(*cp2); ++cp2) |
| 392 | ; | 392 | ; |
| 393 | strncpy(abuf, cp1, sizeof(abuf) - 1); | 393 | *cp2 = '\0'; |
| 394 | abuf[sizeof(abuf) - 1] = *cp2 = '\0'; | 394 | strlcpy(abuf, cp1, sizeof(abuf)); |
| 395 | fclose(fp); | 395 | fclose(fp); |
| 396 | return (abuf); | 396 | return (abuf); |
| 397 | } | 397 | } |
