Fix string-to-int space conversion, bug931.

This commit is contained in:
Wilson Snyder 2015-06-12 07:28:44 -04:00
parent 7578ef889f
commit 6c5884853f
2 changed files with 4 additions and 2 deletions

View File

@ -9,6 +9,8 @@ indicates the contributor was also the author of the fix; Thanks!
**** Fix .c files to be treated as .cpp, bug930. [Jonathon Donaldson]
**** Fix string-to-int space conversion, bug931. [Fabrizio Ferrandi]
* Verilator 3.874 2015-06-06

View File

@ -708,8 +708,8 @@ void _VL_VINT_TO_STRING(int obits, char* destoutp, WDataInP sourcep) {
start = false; // Drop leading 0s
}
}
*destp++ = '\0'; // Terminate
while (isspace(*(destp-1)) && destp>destoutp) *--destp = '\0'; // Drop trailing spaces
*destp = '\0'; // Terminate
if (!start) while (isspace(*(destp-1)) && destp>destoutp) *--destp = '\0'; // Drop trailing spaces
}
void _VL_STRING_TO_VINT(int obits, void* destp, int srclen, const char* srcp) {