static void
sudo_log(int type, const char *fmt, ...)
{
- struct sudo_conv_message msg;
- struct sudo_conv_reply repl;
+ struct sudo_conv_message msg[2];
+ struct sudo_conv_reply repl[2];
va_list ap;
char *str;
int rc;
/* Call conversation function */
memset(&msg, 0, sizeof(msg));
- msg.msg_type = type;
- msg.msg = str;
+ msg[0].msg_type = type;
+ msg[0].msg = str;
+ msg[1].msg_type = type;
+ msg[1].msg = "\n";
memset(&repl, 0, sizeof(repl));
- sudo_conv(1, &msg, &repl);
+ sudo_conv(2, msg, repl);
}
/*
break;
case SUDO_CONV_INFO_MSG:
if (msg->msg)
- (void) puts(msg->msg);
+ (void) fputs(msg->msg, stdout);
break;
case SUDO_CONV_ERROR_MSG:
- if (msg->msg) {
+ if (msg->msg)
(void) fputs(msg->msg, stderr);
- (void) fputc('\n', stderr);
- }
break;
default:
goto err;