From 181410f218a6e59221c53c4bae06893dbea27705 Mon Sep 17 00:00:00 2001 From: Ed Kellett Date: Sun, 14 Feb 2021 00:31:43 +0000 Subject: [PATCH] Make privilegeset_privs more const --- include/privilege.h | 2 +- ircd/privilege.c | 4 ++-- ircd/s_user.c | 2 +- modules/m_privs.c | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/include/privilege.h b/include/privilege.h index 5f26a22f..54143c60 100644 --- a/include/privilege.h +++ b/include/privilege.h @@ -68,7 +68,7 @@ struct privset_diff { }; bool privilegeset_in_set(const struct PrivilegeSet *set, const char *priv); -const char **privilegeset_privs(const struct PrivilegeSet *set); +const char *const *privilegeset_privs(const struct PrivilegeSet *set); struct PrivilegeSet *privilegeset_set_new(const char *name, const char *privs, PrivilegeFlags flags); struct PrivilegeSet *privilegeset_extend(const struct PrivilegeSet *parent, const char *name, const char *privs, PrivilegeFlags flags); struct PrivilegeSet *privilegeset_get(const char *name); diff --git a/ircd/privilege.c b/ircd/privilege.c index 7da649b1..2f2c1cde 100644 --- a/ircd/privilege.c +++ b/ircd/privilege.c @@ -233,7 +233,7 @@ privilegeset_in_set(const struct PrivilegeSet *set, const char *priv) return found != NULL; } -const char ** +const char *const * privilegeset_privs(const struct PrivilegeSet *set) { static const char *no_privs[] = { NULL }; @@ -451,7 +451,7 @@ privilegeset_report(struct Client *source_p) set->name); send_multiline_remote_pad(source_p, &me); send_multiline_remote_pad(source_p, source_p); - for (const char **s = privilegeset_privs(set); *s != NULL; s++) + for (const char *const *s = privilegeset_privs(set); *s != NULL; s++) send_multiline_item(source_p, "%s", *s); send_multiline_fini(source_p, NULL); } diff --git a/ircd/s_user.c b/ircd/s_user.c index e39ed93e..afd37d99 100644 --- a/ircd/s_user.c +++ b/ircd/s_user.c @@ -1492,7 +1492,7 @@ oper_up(struct Client *source_p, struct oper_conf *oper_p) sendto_one(source_p, form_str(RPL_YOUREOPER), me.name, source_p->name); sendto_one_notice(source_p, ":*** Oper privilege set is %s", oper_p->privset->name); send_multiline_init(source_p, " ", ":%s NOTICE %s :*** Oper privs are ", me.name, source_p->name); - for (const char **s = privilegeset_privs(oper_p->privset); *s != NULL; s++) + for (const char *const *s = privilegeset_privs(oper_p->privset); *s != NULL; s++) send_multiline_item(source_p, "%s", *s); send_multiline_fini(source_p, NULL); send_oper_motd(source_p); diff --git a/modules/m_privs.c b/modules/m_privs.c index 443530bb..5e637576 100644 --- a/modules/m_privs.c +++ b/modules/m_privs.c @@ -95,7 +95,7 @@ static void show_privs(struct Client *source_p, struct Client *target_p) send_multiline_remote_pad(source_p, source_p); if (target_p->user->privset) - for (const char **s = privilegeset_privs(target_p->user->privset); *s != NULL; s++) + for (const char *const *s = privilegeset_privs(target_p->user->privset); *s != NULL; s++) send_multiline_item(source_p, "%s", *s); if (IsOper(target_p))