From: Todd C. Miller Date: Fri, 3 Aug 2018 17:45:01 +0000 (-0600) Subject: Fix a warning on FreeBSD which has a fancier __containerof implementation. X-Git-Tag: SUDO_1_8_24^2~21 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=9cc09e4372d9261a94fa14becfb5f79733a8969d;p=sudo Fix a warning on FreeBSD which has a fancier __containerof implementation. --- diff --git a/plugins/sudoers/rcstr.c b/plugins/sudoers/rcstr.c index ef279c116..b9fd475ee 100644 --- a/plugins/sudoers/rcstr.c +++ b/plugins/sudoers/rcstr.c @@ -83,7 +83,7 @@ rcstr_addref(const char *s) if (s == NULL) debug_return_ptr(NULL); - rcs = __containerof(s, struct rcstr, str); + rcs = __containerof((const void *)s, struct rcstr, str); rcs->refcnt++; debug_return_ptr(rcs->str); } @@ -95,7 +95,7 @@ rcstr_delref(const char *s) debug_decl(rcstr_dup, SUDOERS_DEBUG_UTIL) if (s != NULL) { - rcs = __containerof(s, struct rcstr, str); + rcs = __containerof((const void *)s, struct rcstr, str); if (--rcs->refcnt == 0) { rcs->str[0] = '\0'; free(rcs);