Fix a warning on FreeBSD which has a fancier __containerof implementation.

This commit is contained in:
Todd C. Miller
2018-08-03 11:45:01 -06:00
parent 6a692fec31
commit 9cc09e4372

View File

@@ -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);