Merge pull request #14021 from jketema/non-const-format-test

C++: Add `cpp/non-constant-format` test
This commit is contained in:
Jeroen Ketema
2023-08-22 17:38:45 +02:00
committed by GitHub

View File

@@ -156,3 +156,10 @@ void fmt_via_strcpy(char *data) {
strcpy(data, "some string");
printf(data); // BAD
}
void fmt_with_assignment() {
const char *x, *y;
x = y = "a";
printf(y); // GOOD
}