Blame src/regression/scanf-match-literal-eof.c

Szabolcs Nagy cfa23c
// commit: 5efc6af4ebb9d50eb978d0338835544fdfea0396 2011-04-25
Szabolcs Nagy cfa23c
// scanf misreports literal match as input failure when reading EOF (null for sscanf)
Szabolcs Nagy cfa23c
#include <stdio.h>
Szabolcs Nagy cfa23c
#include "test.h"
Szabolcs Nagy cfa23c
Szabolcs Nagy cfa23c
int main(void)
Szabolcs Nagy cfa23c
{
Szabolcs Nagy cfa23c
	char buf[] = { 0 };
Szabolcs Nagy cfa23c
	int match_count;
Szabolcs Nagy cfa23c
Szabolcs Nagy cfa23c
	match_count = sscanf(buf, "a");
Szabolcs Nagy cfa23c
	if(match_count != EOF)
Szabolcs Nagy cfa23c
		t_error("scanf reported match failure instead of input failure on literal EOF match\n");
Szabolcs Nagy cfa23c
Szabolcs Nagy cfa23c
	return t_status;
Szabolcs Nagy cfa23c
}