From 964e32563142885445fdd309bcf20f10e709a7aa Mon Sep 17 00:00:00 2001 From: Anton Staaf Date: Fri, 26 Mar 2010 01:02:36 +0000 Subject: [PATCH] This could become a bug if the error message contained formatting characters that would cause fprintf to try and read varargs that aren't there. Signed-off-by: Anton Staaf >From e59d7b2bf0c36dcb538391c6b7ee6270247c2ca2 Mon Sep 17 00:00:00 2001 From: robotboy Date: Tue, 23 Mar 2010 13:23:39 -0700 Subject: [PATCH] Don't treat the error message as a format string in die(). This could become a bug if the error message contained formatting characters that would cause fprintf to try and read varargs that aren't there. Signed-off-by: Anton Staaf Review URL: http://codereview.chromium.org/1196001 --- disktest/src/disktest.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/disktest/src/disktest.c b/disktest/src/disktest.c index b07feb25f..c7659e9a1 100644 --- a/disktest/src/disktest.c +++ b/disktest/src/disktest.c @@ -43,8 +43,7 @@ unsigned int stop_on_error = 0; void die(char *error) { - fprintf(stderr, error); - fprintf(stderr, "\n"); + fprintf(stderr, "%s\n", error); exit(1); }