Fix write of 0 in '%c' (#6248) (#6249)

This commit is contained in:
Rodrigo Batista de Moraes
2025-08-01 07:54:18 +02:00
committed by GitHub
parent bd1ac03828
commit d0f0919830
4 changed files with 5 additions and 5 deletions
+1 -4
View File
@@ -746,10 +746,7 @@ string V3Number::displayed(FileLine* fl, const string& vformat) const VL_MT_STAB
if (width() > 8)
fl->v3warn(WIDTHTRUNC, "$display-like format of %c format of > 8 bit value");
const unsigned int v = bitsValue(0, 8);
char strc[2];
strc[0] = v & 0xff;
strc[1] = '\0';
str = strc;
str.push_back(static_cast<char>(v));
return str;
}
case 's': {