From a8342a417e48385f7ebc19ab46a940ea1fa060ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Scharfe?= Date: Tue, 13 Sep 2016 18:40:22 +0200 Subject: strbuf: use valid pointer in strbuf_remove() The fourth argument of strbuf_splice() is passed to memcpy(3), which is not supposed to handle NULL pointers. Let's be extra careful and use a valid empty string instead. It even shortens the source code. :) Signed-off-by: Rene Scharfe Signed-off-by: Junio C Hamano --- strbuf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'strbuf.c') diff --git a/strbuf.c b/strbuf.c index 2c08dbb15..e554f1f38 100644 --- a/strbuf.c +++ b/strbuf.c @@ -187,7 +187,7 @@ void strbuf_insert(struct strbuf *sb, size_t pos, const void *data, size_t len) void strbuf_remove(struct strbuf *sb, size_t pos, size_t len) { - strbuf_splice(sb, pos, len, NULL, 0); + strbuf_splice(sb, pos, len, "", 0); } void strbuf_add(struct strbuf *sb, const void *data, size_t len) -- cgit v1.2.1