Add a warning when a single % is at the end of the format string
This commit is contained in:
parent
7e40f5ac52
commit
f8e82448be
|
|
@ -312,8 +312,11 @@ static unsigned int get_format_char(char **rtn, int ljust, int plus,
|
|||
size = strlen(result) + 1; /* fallback value if errors */
|
||||
switch (fmt) {
|
||||
|
||||
case '%':
|
||||
case '\0':
|
||||
vpi_printf("WARNING: %s:%d: a single %% at the end of format string "
|
||||
"%s%s will be displayed as '%%'.\n",
|
||||
info->filename, info->lineno, info->name, fmtb);
|
||||
case '%':
|
||||
if (ljust != 0 || plus != 0 || ld_zero != 0 || width != -1 ||
|
||||
prec != -1) {
|
||||
vpi_printf("WARNING: %s:%d: invalid format %s%s.\n",
|
||||
|
|
|
|||
Loading…
Reference in New Issue