<div dir="auto"><div>You sure those statements are the same? Snprintf doesn't append like strncat. Wouldn't strlcat be the more apt replacement?<br><br><div data-smartmail="gmail_signature">--<br>Sent from my telephone.<br></div><br><div class="gmail_quote"><div dir="ltr">On Fri, Feb 8, 2019, 22:49 Christian Hesse <<a href="mailto:list@eworm.de">list@eworm.de</a> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">From: Christian Hesse <<a href="mailto:mail@eworm.de" target="_blank" rel="noreferrer">mail@eworm.de</a>><br>
<br>
Git version v2.21.0 marks strncat() as banned (commit<br>
ace5707a803eda0f1dde3d776dc3729d3bc7759a), so replace it.<br>
<br>
Signed-off-by: Christian Hesse <<a href="mailto:mail@eworm.de" target="_blank" rel="noreferrer">mail@eworm.de</a>><br>
Reviewed-by: John Keeping <<a href="mailto:john@keeping.me.uk" target="_blank" rel="noreferrer">john@keeping.me.uk</a>><br>
---<br>
ui-ssdiff.c | 4 ++--<br>
1 file changed, 2 insertions(+), 2 deletions(-)<br>
<br>
diff --git a/ui-ssdiff.c b/ui-ssdiff.c<br>
index c456033..1f12cfc 100644<br>
--- a/ui-ssdiff.c<br>
+++ b/ui-ssdiff.c<br>
@@ -136,10 +136,10 @@ static char *replace_tabs(char *line)<br>
for (;;) {<br>
cur_buf = strchr(prev_buf, '\t');<br>
if (!cur_buf) {<br>
- strncat(result, prev_buf, result_len);<br>
+ snprintf(result, result_len, "%s", prev_buf);<br>
break;<br>
} else {<br>
- strncat(result, prev_buf, cur_buf - prev_buf);<br>
+ snprintf(result, cur_buf - prev_buf, "%s", prev_buf);<br>
linelen = strlen(result);<br>
memset(&result[linelen], ' ', 8 - (linelen % 8));<br>
result[linelen + 8 - (linelen % 8)] = '\0';<br>
_______________________________________________<br>
CGit mailing list<br>
<a href="mailto:CGit@lists.zx2c4.com" target="_blank" rel="noreferrer">CGit@lists.zx2c4.com</a><br>
<a href="https://lists.zx2c4.com/mailman/listinfo/cgit" rel="noreferrer noreferrer" target="_blank">https://lists.zx2c4.com/mailman/listinfo/cgit</a><br>
</blockquote></div></div></div>