inet_pton tests, fix regression test case
[libc-test.git] / src / regression / scanf-nullbyte-char.c
blob449922d2ec670bf1c3bc6789893cb7e242c38e0a
1 // commit: ef5507867b59d19f21437970e87b5d0415c07b2e 2013-06-22
2 // scanf should not append null byte after scanning %c
3 #include <stdio.h>
4 #include "test.h"
6 int main(void)
8 char dst[] = { 'a', 'a' };
9 char src[] = { 'b', 'b' };
11 if (sscanf(src, "%c", dst) != 1)
12 t_error("sscanf %%c failed\n");
13 if (dst[1] != 'a')
14 t_error("scanf clobbered the char buffer for %%c conversion\n");
15 return t_status;