Skip to content

Commit d8579ac

Browse files
Ben Peartgitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 883e248 commit d8579ac

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

fsmonitor.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ static int query_fsmonitor(int version, uint64_t last_update, struct strbuf *que
114114
if (!(argv[0] = core_fsmonitor))
115115
return -1;
116116

117-
snprintf(ver, sizeof(version), "%d", version);
117+
snprintf(ver, sizeof(ver), "%d", version);
118118
snprintf(date, sizeof(date), "%" PRIuMAX, (uintmax_t)last_update);
119119
argv[1] = ver;
120120
argv[2] = date;

0 commit comments

Comments
 (0)