~rabbits/public-inbox

Fix a bug in stat_size v1 PROPOSED

d6: 1
 Fix a bug in stat_size

 1 files changed, 3 insertions(+), 1 deletions(-)
Export patchset (mbox)
How do I use this?

Copy & paste the following snippet into your terminal to import this patchset into git:

curl -s https://lists.sr.ht/~rabbits/public-inbox/patches/55135/mbox | git am -3
Learn more about email & git

[PATCH] Fix a bug in stat_size Export this patch

From: d_m <d_m@plastic-idolatry.com>

---
 src/devices/file.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/devices/file.c b/src/devices/file.c
index 56a1baf..3e124fc 100644
--- a/src/devices/file.c
+++ b/src/devices/file.c
@@ -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, '?');
-- 
2.39.5