mirror of
https://github.com/yarrick/iodine.git
synced 2024-11-26 18:19:20 +02:00
Fix readname test
This commit is contained in:
parent
783399e901
commit
5f74a079a6
6
read.c
6
read.c
|
@ -48,7 +48,11 @@ readname_loop(char *packet, char **src, char *dst, size_t length, size_t loop)
|
||||||
c--;
|
c--;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (*s != 0 && len < length - 1)
|
if (len < length - 1) {
|
||||||
|
break; /* We used up all space */
|
||||||
|
}
|
||||||
|
|
||||||
|
if (*s != 0)
|
||||||
*d++ = '.';
|
*d++ = '.';
|
||||||
}
|
}
|
||||||
(*src) = s+1;
|
(*src) = s+1;
|
||||||
|
|
1
test.c
1
test.c
|
@ -146,7 +146,6 @@ test_readname()
|
||||||
data = longname + sizeof(HEADER);
|
data = longname + sizeof(HEADER);
|
||||||
buf[256] = '\a';
|
buf[256] = '\a';
|
||||||
rv = readname(longname, &data, buf, 256);
|
rv = readname(longname, &data, buf, 256);
|
||||||
printf("got %d, '%s' len %d \n", rv, buf, strlen(buf));
|
|
||||||
assert(buf[256] == '\a');
|
assert(buf[256] == '\a');
|
||||||
|
|
||||||
printf("OK\n");
|
printf("OK\n");
|
||||||
|
|
Loading…
Reference in New Issue