Fix bug in output of null character with %c format.
This commit is contained in:
parent
5aae9ea770
commit
9d0d1938dc
|
|
@ -407,13 +407,13 @@ static unsigned int get_format_char(char **rtn, int ljust, int plus,
|
|||
vpi_printf("WARNING: %s:%d: missing argument for %s%s.\n",
|
||||
info->filename, info->lineno, info->name, fmtb);
|
||||
} else {
|
||||
value.format = vpiStringVal;
|
||||
value.format = vpiIntVal;
|
||||
vpi_get_value(info->items[*idx], &value);
|
||||
if (value.format == vpiSuppressVal) {
|
||||
vpi_printf("WARNING: %s:%d: incompatible value for %s%s.\n",
|
||||
info->filename, info->lineno, info->name, fmtb);
|
||||
} else {
|
||||
char ch = value.value.str[strlen(value.value.str)-1];
|
||||
char ch = value.value.integer;
|
||||
|
||||
/* If the width is less than one then use a width of one. */
|
||||
if (width < 1) width = 1;
|
||||
|
|
|
|||
Loading…
Reference in New Issue