You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
ASSERT_EQUALS("[test.cpp:9:5]: (error) Read and write operations without a call to a positioning function (fseek, fsetpos or rewind) or fflush in between result in undefined behaviour. [IOWithoutPositioning]\n", errout_str());
@@ -892,6 +910,14 @@ class TestIO : public TestFixture {
892
910
"[test.cpp:3:5]: (error) Width 42 given in format string (no. 2) is larger than destination buffer 's2[42]', use %41[a-z] to prevent overflowing it. [invalidScanfFormatWidth]\n", errout_str());
893
911
}
894
912
913
+
voidtestScanf6() {
914
+
ASSERT_NO_THROW(check("int f(const char *p) {\n"
915
+
" char a[3];\n"
916
+
" return sscanf(p, \"%02s\", a);\n"
917
+
"}\n"));
918
+
ASSERT_EQUALS("", errout_str());
919
+
}
920
+
895
921
896
922
#defineTEST_SCANF_CODE(format, type) \
897
923
"void f(){" type " x; scanf(\"" format "\", &x);}"
0 commit comments