Don't print garbage at the end of the custom lecture.

This commit is contained in:
Todd C. Miller
2011-11-12 13:08:13 -05:00
parent ab437ae6c3
commit f190bcf94b

View File

@@ -212,7 +212,7 @@ lecture(int status)
if (def_lecture_file && (fp = fopen(def_lecture_file, "r")) != NULL) {
while ((nread = fread(buf, sizeof(char), sizeof(buf) - 1, fp)) != 0) {
buf[sizeof(buf) - 1] = '\0';
buf[nread] = '\0';
msg.msg_type = SUDO_CONV_ERROR_MSG;
msg.msg = buf;
sudo_conv(1, &msg, &repl);