Thread (1 message) 1 message, 1 author, 2018-08-18

Re: Re* [PATCH v7 1/1] sideband: highlight keywords in remote sideband output

From: Junio C Hamano <hidden>
Date: 2018-08-18 16:02:41

Junio C Hamano [off-list ref] writes:
quoted
quoted
-	strbuf_add(dest, src, n);
+	if (0 < n)
+		strbuf_add(dest, src, n);
This check seems unnecessary.  strbuf_add can cope fine with !n.
I was primarily interested in catching negatives, and !n was a mere
optimization, but you are correct to point out that negative n at
this point in the codeflow is a BUG().
Actually, let's just lose the conditional.  strbuf_add() would catch
and issue an error message when it notices that we fed negative
count anyway ;-).
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help