From 81dd9639ede71ce6ca814eff07104a5b7d5be2a3 Mon Sep 17 00:00:00 2001 From: Justine Tunney Date: Sat, 27 Jul 2024 18:34:21 -0700 Subject: [PATCH] Fix bug in tool/decode/zip --- tool/decode/zip.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tool/decode/zip.c b/tool/decode/zip.c index 6b4cf88b2..96a88ab2e 100644 --- a/tool/decode/zip.c +++ b/tool/decode/zip.c @@ -78,7 +78,7 @@ char *xiso8601(struct timespec ts) { ptr += snprintf(ptr, end - ptr, "%09ld", ts.tv_nsec); ptr += strftime(ptr, end - ptr, "%z", &tm); unassert(ptr + 1 <= end); - unassert(realloc_in_place(res, ptr - end) == res); + unassert(realloc_in_place(res, ptr + 1 - res) == res); return res; }