git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v1] fsmonitor: fix incorrect buffer size when printing version number
@ 2018-04-10 18:43 Ben Peart
  2018-04-10 20:17 ` Eric Sunshine
  0 siblings, 1 reply; 4+ messages in thread
From: Ben Peart @ 2018-04-10 18:43 UTC (permalink / raw)
  To: git, gitster, alexmv, avarab, johannes.schindelin; +Cc: Ben Peart

This is a trivial bug fix for passing the incorrect size to snprintf() when
outputing 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>
---

Notes:
    Base Ref: v2.17.0
    Web-Diff: https://github.com/benpeart/git/commit/0bc3fc3b74
    Checkout: git fetch https://github.com/benpeart/git fsmonitor-version-v1 && git checkout 0bc3fc3b74

 fsmonitor.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fsmonitor.c b/fsmonitor.c
index 6d7bcd5d0e..eb4e642256 100644
--- a/fsmonitor.c
+++ b/fsmonitor.c
@@ -104,7 +104,7 @@ static int query_fsmonitor(int version, uint64_t last_update, struct strbuf *que
 	if (!(argv[0] = core_fsmonitor))
 		return -1;
 
-	snprintf(ver, sizeof(version), "%d", version);
+	snprintf(ver, sizeof(ver), "%d", version);
 	snprintf(date, sizeof(date), "%" PRIuMAX, (uintmax_t)last_update);
 	argv[1] = ver;
 	argv[2] = date;

base-commit: 468165c1d8a442994a825f3684528361727cd8c0
-- 
2.17.0.windows.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH v1] fsmonitor: fix incorrect buffer size when printing version number
  2018-04-10 18:43 [PATCH v1] fsmonitor: fix incorrect buffer size when printing version number Ben Peart
@ 2018-04-10 20:17 ` Eric Sunshine
  2018-04-13 12:18   ` Ben Peart
  0 siblings, 1 reply; 4+ messages in thread
From: Eric Sunshine @ 2018-04-10 20:17 UTC (permalink / raw)
  To: Ben Peart; +Cc: git, gitster, alexmv, avarab, johannes.schindelin

On Tue, Apr 10, 2018 at 2:43 PM, Ben Peart <Ben.Peart@microsoft.com> wrote:
> This is a trivial bug fix for passing the incorrect size to snprintf() when
> outputing the version.  It should be passing the size of the destination buffer

s/outputing/outputting/

> rather than the size of the value being printed.
>
> Signed-off-by: Ben Peart <benpeart@microsoft.com>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH v1] fsmonitor: fix incorrect buffer size when printing version number
  2018-04-10 20:17 ` Eric Sunshine
@ 2018-04-13 12:18   ` Ben Peart
  2018-04-16  1:00     ` Junio C Hamano
  0 siblings, 1 reply; 4+ messages in thread
From: Ben Peart @ 2018-04-13 12:18 UTC (permalink / raw)
  To: Eric Sunshine, Ben Peart, gitster
  Cc: git, alexmv, avarab, johannes.schindelin



On 4/10/2018 4:17 PM, Eric Sunshine wrote:
> On Tue, Apr 10, 2018 at 2:43 PM, Ben Peart <Ben.Peart@microsoft.com> wrote:
>> This is a trivial bug fix for passing the incorrect size to snprintf() when
>> outputing the version.  It should be passing the size of the destination buffer
> 
> s/outputing/outputting/
> 
>> rather than the size of the value being printed.
>>
>> Signed-off-by: Ben Peart <benpeart@microsoft.com>

Junio, do you want a re-roll of this simple fix or can you fix the 
spelling of the commit message?

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH v1] fsmonitor: fix incorrect buffer size when printing version number
  2018-04-13 12:18   ` Ben Peart
@ 2018-04-16  1:00     ` Junio C Hamano
  0 siblings, 0 replies; 4+ messages in thread
From: Junio C Hamano @ 2018-04-16  1:00 UTC (permalink / raw)
  To: Ben Peart
  Cc: Eric Sunshine, Ben Peart, git, alexmv, avarab, johannes.schindelin

Ben Peart <peartben@gmail.com> writes:

> On 4/10/2018 4:17 PM, Eric Sunshine wrote:
>> On Tue, Apr 10, 2018 at 2:43 PM, Ben Peart <Ben.Peart@microsoft.com> wrote:
>>> This is a trivial bug fix for passing the incorrect size to snprintf() when
>>> outputing the version.  It should be passing the size of the destination buffer
>>
>> s/outputing/outputting/
>>
>>> rather than the size of the value being printed.
>>>
>>> Signed-off-by: Ben Peart <benpeart@microsoft.com>
>
> Junio, do you want a re-roll of this simple fix or can you fix the
> spelling of the commit message?

I think I already have that typofix in what is queued.

If there is anything more, I'd prefer to replace with a reroll ;-)

Thanks.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2018-04-16  1:00 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-04-10 18:43 [PATCH v1] fsmonitor: fix incorrect buffer size when printing version number Ben Peart
2018-04-10 20:17 ` Eric Sunshine
2018-04-13 12:18   ` Ben Peart
2018-04-16  1:00     ` Junio C Hamano

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).