fsmonitor: fix incorrect buffer size when printing version number
This is a trivial bug fix for passing the incorrect size to snprintf() when outputting the version. It should be passing the size of the destination buffer rather than the size of the value being printed. Signed-off-by: Ben Peart <benpeart@microsoft.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Ben Peart committed
Apr 10, 2018 at 18:43 UTC
d8579accfaea398a157a3a8ad2ca6cac25f1b999
1 file changed
+1
-1
fsmonitor.c
+1
-1
@@ -114,7 +114,7 @@ static int query_fsmonitor(int version, uint64_t last_update, struct strbuf *que
114
if (!(argv[0] = core_fsmonitor))
115
return -1;
116
117
- snprintf(ver, sizeof(version), "%d", version);
117
+ snprintf(ver, sizeof(ver), "%d", version);
118
snprintf(date, sizeof(date), "%" PRIuMAX, (uintmax_t)last_update);
119
argv[1] = ver;
120
argv[2] = date;