summaryrefslogtreecommitdiff
path: root/lib/libc
diff options
context:
space:
mode:
authorJohn Baldwin <jhb@FreeBSD.org>2020-09-01 16:20:42 +0000
committerJohn Baldwin <jhb@FreeBSD.org>2020-09-01 16:20:42 +0000
commitff38047b0c077d354535a4920d1f84bed45d87f0 (patch)
tree5611cc4166ec5a8775789390bf46a7f9daf1859a /lib/libc
parent2b33ffde2e929b16f8a1d8c3d68019825c22d114 (diff)
Notes
Diffstat (limited to 'lib/libc')
-rw-r--r--lib/libc/tests/resolv/resolv_test.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/libc/tests/resolv/resolv_test.c b/lib/libc/tests/resolv/resolv_test.c
index 1da42e3bcd182..6668ad722e0cc 100644
--- a/lib/libc/tests/resolv/resolv_test.c
+++ b/lib/libc/tests/resolv/resolv_test.c
@@ -76,15 +76,15 @@ load(const char *fname)
if ((fp = fopen(fname, "r")) == NULL)
ATF_REQUIRE(fp != NULL);
while ((line = fgetln(fp, &len)) != NULL) {
- char c = line[len];
+ char c = line[len - 1];
char *ptr;
- line[len] = '\0';
+ line[len - 1] = '\0';
for (ptr = strtok(line, WS); ptr; ptr = strtok(NULL, WS)) {
if (ptr == '\0' || ptr[0] == '#')
continue;
sl_add(hosts, strdup(ptr));
}
- line[len] = c;
+ line[len - 1] = c;
}
(void)fclose(fp);