2
0
mirror of https://github.com/sudo-project/sudo.git synced 2025-09-03 15:55:40 +00:00

In sudoers_format_userspecs make the separator optional and silence

a printf format warning.
This commit is contained in:
Todd C. Miller
2018-03-06 13:42:56 -07:00
parent f984de1ba9
commit bb31544fcc
2 changed files with 4 additions and 4 deletions

View File

@@ -291,14 +291,14 @@ sudoers_format_userspec(struct sudo_lbuf *lbuf, struct userspec *us,
*/
bool
sudoers_format_userspecs(struct sudo_lbuf *lbuf, struct userspec_list *usl,
const char *sep, bool expand_aliases, bool flush)
const char *separator, bool expand_aliases, bool flush)
{
struct userspec *us;
debug_decl(sudoers_format_userspecs, SUDOERS_DEBUG_UTIL)
TAILQ_FOREACH(us, usl, entries) {
if (us != TAILQ_FIRST(usl))
sudo_lbuf_append(lbuf, sep);
if (separator != NULL && us != TAILQ_FIRST(usl))
sudo_lbuf_append(lbuf, "%s", separator);
if (!sudoers_format_userspec(lbuf, us, expand_aliases))
break;
sudo_lbuf_print(lbuf);

View File

@@ -323,6 +323,6 @@ bool sudoers_format_default_line(struct sudo_lbuf *lbuf, struct defaults *d, str
bool sudoers_format_member(struct sudo_lbuf *lbuf, struct member *m, const char *separator, int alias_type);
bool sudoers_format_privilege(struct sudo_lbuf *lbuf, struct privilege *priv, bool expand_aliases);
bool sudoers_format_userspec(struct sudo_lbuf *lbuf, struct userspec *us, bool expand_aliases);
bool sudoers_format_userspecs(struct sudo_lbuf *lbuf, struct userspec_list *usl, const char *sep, bool expand_aliases, bool flush);
bool sudoers_format_userspecs(struct sudo_lbuf *lbuf, struct userspec_list *usl, const char *separator, bool expand_aliases, bool flush);
#endif /* SUDOERS_PARSE_H */