• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // commit: ef5507867b59d19f21437970e87b5d0415c07b2e 2013-06-22
2 // scanf should not append null byte after scanning %c
3 #include <stdio.h>
4 #include "test.h"
5 
main(void)6 int main(void)
7 {
8 	char dst[] = { 'a', 'a' };
9 	char src[] = { 'b', 'b', 0 };
10 
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;
16 }
17