Forráskód Böngészése

Merge pull request #343 from actatux/remove_null_char_in_write

Don't print the null character to stdout
Bryan Heden 7 éve
szülő
commit
cf2b584318
1 módosított fájl, 2 hozzáadás és 2 törlés
  1. 2 2
      plugins/popen.c

+ 2 - 2
plugins/popen.c

@@ -305,10 +305,10 @@ popen_timeout_alarm_handler (int signo)
 			}
 			/* printf (_("CRITICAL - Plugin timed out after %d seconds\n"),
 						timeout_interval); */
-			write(STDOUT_FILENO, msg1, sizeof(msg1));
+			write(STDOUT_FILENO, msg1, sizeof(msg1) - 1);
 		} else {
 			/* printf ("%s\n", _("CRITICAL - popen timeout received, but no child process")); */
-			write(STDOUT_FILENO, msg2, sizeof(msg2));
+			write(STDOUT_FILENO, msg2, sizeof(msg2) - 1);
 		}
 		exit (STATE_CRITICAL);
 	}