Avoid cppcheck warning

This commit is contained in:
Thorsten Horstmann 2015-02-24 22:41:26 +08:00
parent 1809f741cb
commit c5f3c550a6

View File

@ -99,7 +99,9 @@ buffer* buf_newcopy(buffer* buf) {
ret = buf_new(buf->len); ret = buf_new(buf->len);
ret->len = buf->len; ret->len = buf->len;
if (buf->len > 0) {
memcpy(ret->data, buf->data, buf->len); memcpy(ret->data, buf->data, buf->len);
}
return ret; return ret;
} }