]> git.ipfire.org Git - thirdparty/git.git/commit - strbuf.c
strbuf: use valid pointer in strbuf_remove()
authorRené Scharfe <l.s.r@web.de>
Tue, 13 Sep 2016 16:40:22 +0000 (18:40 +0200)
committerJunio C Hamano <gitster@pobox.com>
Tue, 13 Sep 2016 23:07:37 +0000 (16:07 -0700)
commita8342a417e48385f7ebc19ab46a940ea1fa060ae
treed0b3415ceff91022553a6432cb7a185d988f109c
parent0b65a8dbdb38962e700ee16776a3042beb489060
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 <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
strbuf.c