From 9cc09e4372d9261a94fa14becfb5f79733a8969d Mon Sep 17 00:00:00 2001 From: "Todd C. Miller" Date: Fri, 3 Aug 2018 11:45:01 -0600 Subject: [PATCH] Fix a warning on FreeBSD which has a fancier __containerof implementation. --- plugins/sudoers/rcstr.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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); -- 2.40.0