projects
/
cparser
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
eb03800
)
Check for dangling % in format strings after consuming modifiers.
author
Christoph Mallon
<christoph.mallon@gmx.de>
Sat, 19 May 2012 07:18:48 +0000
(09:18 +0200)
committer
Christoph Mallon
<christoph.mallon@gmx.de>
Sat, 19 May 2012 08:10:37 +0000
(10:10 +0200)
format_check.c
patch
|
blob
|
history
diff --git
a/format_check.c
b/format_check.c
index
f808b11
..
332c9c6
100644
(file)
--- a/
format_check.c
+++ b/
format_check.c
@@
-144,10
+144,6
@@
static int internal_check_printf_format(const expression_t *fmt_expr,
continue;
fmt = *(++c);
- if (fmt == '\0') {
- warningf(WARN_FORMAT, pos, "dangling %% in format string");
- break;
- }
if (fmt == '%')
continue;
@@
-322,6
+318,10
@@
break_fmt_flags:
break;
}
+ if (fmt == '\0') {
+ warningf(WARN_FORMAT, pos, "dangling %% in format string");
+ break;
+ }
type_t *expected_type;
type_qualifiers_t expected_qual = TYPE_QUALIFIER_NONE;