Improved invalidScanf error message

This commit is contained in:
Moshe Kaplan 2014-08-06 06:08:28 +02:00 committed by Daniel Marjamäki
parent f2fdc4fb14
commit 4894d3807d
1 changed files with 6 additions and 1 deletions

View File

@ -426,7 +426,12 @@ void CheckIO::invalidScanfError(const Token *tok, bool portability)
" return 0;\n"
"}\n"
"\n"
"To make it crash, type in more than 5 characters.");
"Typing in 5 or more characters may make the program crash. The correct usage "
"here is 'scanf(\"%4s\", c);', as the maximum field width does not include the "
"terminating null byte.\n"
"Source: http://linux.die.net/man/3/scanf\n"
"Source: http://www.opensource.apple.com/source/xnu/xnu-1456.1.26/libkern/stdio/scanf.c"
);
}
//---------------------------------------------------------------------------