From 2bd3d9ed5d23c52f911411794b02ffa538423788 Mon Sep 17 00:00:00 2001 From: Stephen Williams Date: Sat, 23 Jun 2012 08:56:38 -0700 Subject: [PATCH] Allow strings to be constructed formats in $display et al. --- vpi/sys_display.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/vpi/sys_display.c b/vpi/sys_display.c index 1dfe1b19e..6d92268f3 100644 --- a/vpi/sys_display.c +++ b/vpi/sys_display.c @@ -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: