lib/buffer: make it robust for static analyzers [coverity scan]
Signed-off-by: Karel Zak <kzak@redhat.com>
This commit is contained in:
parent
865f5f469c
commit
f831651e3a
|
@ -81,6 +81,9 @@ int ul_buffer_append_data(struct ul_buffer *buf, const char *data, size_t sz)
|
|||
if (rc)
|
||||
return rc;
|
||||
}
|
||||
if (!buf->end)
|
||||
return -EINVAL; /* make static analyzers happy */
|
||||
|
||||
memcpy(buf->end, data, sz);
|
||||
buf->end += sz;
|
||||
*buf->end = '\0'; /* make sure it's terminated */
|
||||
|
|
Loading…
Reference in New Issue