Allow strings to be constructed formats in $display et al.

This commit is contained in:
Stephen Williams 2012-06-23 08:56:38 -07:00
parent cf1b83b8f0
commit 2bd3d9ed5d
1 changed files with 4 additions and 2 deletions

View File

@ -969,9 +969,11 @@ static char *get_display(unsigned int *rtnsz, const struct strobe_cb_info *info)
case vpiStringVar:
value.format = vpiStringVal;
vpi_get_value(item, &value);
width = strlen(value.value.str);
fmt = strdup(value.value.str);
width = get_format(&result, fmt, info, &idx);
free(fmt);
rtn = realloc(rtn, (size+width)*sizeof(char));
memcpy(rtn+size-1, value.value.str, width);
memcpy(rtn+size-1, result, width);
break;
case vpiSysFuncCall: