зеркало из https://github.com/microsoft/git.git
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>
This commit is contained in:
Родитель
0b65a8dbdb
Коммит
a8342a417e
2
strbuf.c
2
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)
|
||||
|
|
Загрузка…
Ссылка в новой задаче