From 99224d3946a83b6b6b02335b2ea4aff622d8b352 Mon Sep 17 00:00:00 2001 From: Stephen Heumann Date: Sun, 31 Dec 2017 16:07:51 -0600 Subject: [PATCH] Address a couple errors identified by ORCA/C 2.2.0 B2. One of these concerned socket-related structures that aren't really used in hush. The other was a reliance on a GCC-specific feature (arithmetic on void pointers); this code is actually used in hush, although I'm not sure if the error was causing any real problems. --- include/libbb.h | 1 - include/platform.h | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/include/libbb.h b/include/libbb.h index c76b0b026..0ed57c952 100644 --- a/include/libbb.h +++ b/include/libbb.h @@ -556,7 +556,6 @@ typedef struct len_and_sockaddr { socklen_t len; union { struct sockaddr sa; - struct sockaddr_in sin; #if ENABLE_FEATURE_IPV6 struct sockaddr_in6 sin6; #endif diff --git a/include/platform.h b/include/platform.h index 3c4fe5677..69b1a71ce 100644 --- a/include/platform.h +++ b/include/platform.h @@ -527,7 +527,7 @@ extern char *stpcpy(char *p, const char *to_add) FAST_FUNC; #define mempcpy bb__mempcpy static ALWAYS_INLINE void *mempcpy(void *dest, const void *src, size_t len) { - return memcpy(dest, src, len) + len; + return (char *)memcpy(dest, src, len) + len; } #endif