From d607205486d7ea11f2cbf3dcc3d5e7e6b53f1d0f Mon Sep 17 00:00:00 2001 From: Maria Matejka Date: Wed, 14 Aug 2019 10:28:23 +0200 Subject: Not calling memcpy with n=0. --- lib/string.h | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'lib') diff --git a/lib/string.h b/lib/string.h index d6ae5ef7..0f650178 100644 --- a/lib/string.h +++ b/lib/string.h @@ -72,6 +72,15 @@ bstrcmp(const char *s1, const char *s2) return !s2 - !s1; } +static inline void * +bmemcpy(void *dest, const void *src, size_t n) +{ + if (n) + return memcpy(dest, src, n); + else + return dest; +} + #define ROUTER_ID_64_LENGTH 23 #endif -- cgit v1.2.3