[PATCH] fix two compile time warnings

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Maciej Åenczykowski <maze@xxxxxxxxxx>

jobs.c: In function 'sprint_status':
jobs.c:427: warning: format not a string literal and no format arguments

trap.c: In function 'exitshell':
trap.c:354: warning: variable 'status' might be clobbered by 'longjmp' or 'vfork'

Signed-off-by: Maciej Åenczykowski <maze@xxxxxxxxxx>
---
 src/jobs.c |    2 +-
 src/trap.c |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/jobs.c b/src/jobs.c
index 826a9af..44a6401 100644
--- a/src/jobs.c
+++ b/src/jobs.c
@@ -425,7 +425,7 @@ sprint_status(char *s, int status, int sigonly)
 				goto out;
 #endif
 		}
-		col = fmtstr(s, 32, strsignal(st));
+		col = fmtstr(s, 32, "%s", strsignal(st));
 		if (WCOREDUMP(status)) {
 			col += fmtstr(s + col, 16, " (core dumped)");
 		}
diff --git a/src/trap.c b/src/trap.c
index 7bd60ab..a3c4397 100644
--- a/src/trap.c
+++ b/src/trap.c
@@ -369,7 +369,7 @@ exitshell(void)
 {
 	struct jmploc loc;
 	char *p;
-	int status;
+	volatile int status;
 
 #ifdef HETIO
 	hetio_reset_term();
-- 
1.7.1

--
To unsubscribe from this list: send the line "unsubscribe dash" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [LARTC]     [Bugtraq]     [Yosemite Forum]     [Photo]

  Powered by Linux