From: Todd C. Miller Date: Mon, 15 Mar 2010 22:13:31 +0000 (-0400) Subject: Add newline at the end of message and space after the colon in warning message X-Git-Tag: SUDO_1_8_0~810 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=718073e2719e8c1a1f86c224049781652b5e8f69;p=sudo Add newline at the end of message and space after the colon in warning message --- diff --git a/plugins/sudoers/error.c b/plugins/sudoers/error.c index 9278e34e9..ce12872ea 100644 --- a/plugins/sudoers/error.c +++ b/plugins/sudoers/error.c @@ -76,10 +76,10 @@ warningx(const char *fmt, ...) static void _warning(int use_errno, const char *fmt, va_list ap) { - struct sudo_conv_message msg[5]; - struct sudo_conv_reply repl[5]; + struct sudo_conv_message msg[6]; + struct sudo_conv_reply repl[6]; char *str; - int nmsgs = 3; + int nmsgs = 4; evasprintf(&str, fmt, ap); @@ -88,16 +88,18 @@ _warning(int use_errno, const char *fmt, va_list ap) msg[0].msg_type = SUDO_CONV_ERROR_MSG; msg[0].msg = getprogname(); msg[1].msg_type = SUDO_CONV_ERROR_MSG; - msg[1].msg = ":"; + msg[1].msg = ": "; msg[2].msg_type = SUDO_CONV_ERROR_MSG; msg[2].msg = str; if (use_errno) { msg[3].msg_type = SUDO_CONV_ERROR_MSG; - msg[3].msg = ":"; + msg[3].msg = ": "; msg[4].msg_type = SUDO_CONV_ERROR_MSG; msg[4].msg = strerror(errno); - nmsgs = 5; + nmsgs = 6; } + msg[nmsgs - 1].msg_type = SUDO_CONV_ERROR_MSG; + msg[nmsgs - 1].msg = "\n"; memset(&repl, 0, sizeof(repl)); sudo_conv(nmsgs, msg, repl); }