3
0
Fork 0
mirror of https://github.com/YosysHQ/yosys synced 2025-04-07 09:55:20 +00:00

libs/fst: Update from upstream

Fixes stringop-overread warning
This commit is contained in:
Krystine Sherwin 2025-02-25 17:00:12 +13:00
parent 98f0ddd636
commit 67a0248186
No known key found for this signature in database

View file

@ -3907,16 +3907,18 @@ while (value)
static int fstVcdIDForFwrite(char *buf, unsigned int value) static int fstVcdIDForFwrite(char *buf, unsigned int value)
{ {
char *pnt = buf; char *pnt = buf;
int len = 0;
/* zero is illegal for a value...it is assumed they start at one */ /* zero is illegal for a value...it is assumed they start at one */
while (value) while (value && len < 14)
{ {
value--; value--;
++len;
*(pnt++) = (char)('!' + value % 94); *(pnt++) = (char)('!' + value % 94);
value = value / 94; value = value / 94;
} }
return(pnt - buf); return len;
} }