diff options
author | Thorsten Horstmann <thorsten.horstmann@web.de> | 2015-02-24 22:41:26 +0800 |
---|---|---|
committer | Thorsten Horstmann <thorsten.horstmann@web.de> | 2015-02-24 22:41:26 +0800 |
commit | c5f3c550a6c9dc14655e17e1a809d18b953deb27 (patch) | |
tree | 5bf40c46b102e08013dff70eada8abe33b5e9abc /buffer.c | |
parent | 1809f741cba865b03d4db5c4ba8c41364a55d6bc (diff) |
Avoid cppcheck warning
Diffstat (limited to 'buffer.c')
-rw-r--r-- | buffer.c | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -99,7 +99,9 @@ buffer* buf_newcopy(buffer* buf) { ret = buf_new(buf->len); ret->len = buf->len; - memcpy(ret->data, buf->data, buf->len); + if (buf->len > 0) { + memcpy(ret->data, buf->data, buf->len); + } return ret; } |