Fix a bug in stat_size

This commit is contained in:
~d6 2024-09-20 22:25:10 -04:00
parent df51651789
commit 8235df5a43
1 changed files with 3 additions and 1 deletions

View File

@ -282,7 +282,9 @@ stat_size(Uint8 *dest, Uint16 len, off_t size)
Uint16 i;
dest += len - 1;
for (i = 0; i < len; i++) {
*(dest--) = '0' + (Uint8)(size & 0xf);
char c = '0' + (Uint8)(size & 0xf);
if (c > '9') c += 39;
*(dest--) = c;
size = size >> 4;
}
return size == 0 ? len : stat_fill(dest, len, '?');