{"thread":{"id":"48259","subject":"[PATCH v1] fsmonitor: fix incorrect buffer size when printing version number","startedAt":"2018-04-10T18:43:52Z","lastAt":"2018-04-16T01:00:28Z","messageCount":4,"participants":["Ben Peart","Eric Sunshine","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"344370","messageId":"20180410184327.13896-1-benpeart@microsoft.com","threadId":"48259","inReplyTo":null,"subject":"[PATCH v1] fsmonitor: fix incorrect buffer size when printing version number","fromName":"Ben Peart","fromEmail":"ben.peart@microsoft.com","sentAt":"2018-04-10T18:43:43Z","receivedAt":"2018-04-10T18:43:52Z","isPatch":true,"sender":{"key":"benpeart@microsoft.com","avatar":"https://avatars.githubusercontent.com/u/15252029?v=4"},"body":"This is a trivial bug fix for passing the incorrect size to snprintf() when\noutputing the version.  It should be passing the size of the destination buffer\nrather than the size of the value being printed.\n\nSigned-off-by: Ben Peart <benpeart@microsoft.com>\n---\n\nNotes:\n    Base Ref: v2.17.0\n    Web-Diff: https://github.com/benpeart/git/commit/0bc3fc3b74\n    Checkout: git fetch https://github.com/benpeart/git fsmonitor-version-v1 && git checkout 0bc3fc3b74\n\n fsmonitor.c | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\ndiff --git a/fsmonitor.c b/fsmonitor.c\nindex 6d7bcd5d0e..eb4e642256 100644\n--- a/fsmonitor.c\n+++ b/fsmonitor.c\n@@ -104,7 +104,7 @@ static int query_fsmonitor(int version, uint64_t last_update, struct strbuf *que\n \tif (!(argv[0] = core_fsmonitor))\n \t\treturn -1;\n \n-\tsnprintf(ver, sizeof(version), \"%d\", version);\n+\tsnprintf(ver, sizeof(ver), \"%d\", version);\n \tsnprintf(date, sizeof(date), \"%\" PRIuMAX, (uintmax_t)last_update);\n \targv[1] = ver;\n \targv[2] = date;\n\nbase-commit: 468165c1d8a442994a825f3684528361727cd8c0\n-- \n2.17.0.windows.1\n\n"},{"id":"344385","messageId":"CAPig+cRvujJ2RmH62qnjS8asRn0wc+f-O+KA01NfFXuJDk3fog@mail.gmail.com","threadId":"48259","inReplyTo":"20180410184327.13896-1-benpeart@microsoft.com","subject":"Re: [PATCH v1] fsmonitor: fix incorrect buffer size when printing version number","fromName":"Eric Sunshine","fromEmail":"sunshine@sunshineco.com","sentAt":"2018-04-10T20:17:59Z","receivedAt":"2018-04-10T20:18:06Z","isPatch":true,"sender":{"key":"sunshine@sunshineco.com","avatar":"https://avatars.githubusercontent.com/u/163641?v=4"},"body":"On Tue, Apr 10, 2018 at 2:43 PM, Ben Peart <Ben.Peart@microsoft.com> wrote:\n> This is a trivial bug fix for passing the incorrect size to snprintf() when\n> outputing the version.  It should be passing the size of the destination buffer\n\ns/outputing/outputting/\n\n> rather than the size of the value being printed.\n>\n> Signed-off-by: Ben Peart <benpeart@microsoft.com>\n"},{"id":"344604","messageId":"2b6b2a54-8349-ea28-f752-4d752c798d5a@gmail.com","threadId":"48259","inReplyTo":"CAPig+cRvujJ2RmH62qnjS8asRn0wc+f-O+KA01NfFXuJDk3fog@mail.gmail.com","subject":"Re: [PATCH v1] fsmonitor: fix incorrect buffer size when printing version number","fromName":"Ben Peart","fromEmail":"peartben@gmail.com","sentAt":"2018-04-13T12:18:08Z","receivedAt":"2018-04-13T12:18:15Z","isPatch":true,"sender":{"key":"benpeart@microsoft.com","avatar":"https://avatars.githubusercontent.com/u/15252029?v=4"},"body":"\n\nOn 4/10/2018 4:17 PM, Eric Sunshine wrote:\n> On Tue, Apr 10, 2018 at 2:43 PM, Ben Peart <Ben.Peart@microsoft.com> wrote:\n>> This is a trivial bug fix for passing the incorrect size to snprintf() when\n>> outputing the version.  It should be passing the size of the destination buffer\n> \n> s/outputing/outputting/\n> \n>> rather than the size of the value being printed.\n>>\n>> Signed-off-by: Ben Peart <benpeart@microsoft.com>\n\nJunio, do you want a re-roll of this simple fix or can you fix the \nspelling of the commit message?\n"},{"id":"344764","messageId":"xmqqk1t8ynh6.fsf@gitster-ct.c.googlers.com","threadId":"48259","inReplyTo":"2b6b2a54-8349-ea28-f752-4d752c798d5a@gmail.com","subject":"Re: [PATCH v1] fsmonitor: fix incorrect buffer size when printing version number","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2018-04-16T01:00:21Z","receivedAt":"2018-04-16T01:00:28Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Ben Peart <peartben@gmail.com> writes:\n\n> On 4/10/2018 4:17 PM, Eric Sunshine wrote:\n>> On Tue, Apr 10, 2018 at 2:43 PM, Ben Peart <Ben.Peart@microsoft.com> wrote:\n>>> This is a trivial bug fix for passing the incorrect size to snprintf() when\n>>> outputing the version.  It should be passing the size of the destination buffer\n>>\n>> s/outputing/outputting/\n>>\n>>> rather than the size of the value being printed.\n>>>\n>>> Signed-off-by: Ben Peart <benpeart@microsoft.com>\n>\n> Junio, do you want a re-roll of this simple fix or can you fix the\n> spelling of the commit message?\n\nI think I already have that typofix in what is queued.\n\nIf there is anything more, I'd prefer to replace with a reroll ;-)\n\nThanks.\n"}]}