summarylogtreecommitdiffstats
path: root/fixWformat.patch
blob: b7680a7f30457278aba8a934387bb0525a375b18 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
From 4f8f9f17dae461aa40d1b3519c1921648df18fd4 Mon Sep 17 00:00:00 2001
From: darealshinji <djcj@gmx.de>
Date: Tue, 25 Nov 2014 13:03:22 +0100
Subject: [PATCH] fix some -Wformat-security warnings for gcc

---
 mozilla-1.9.2/mozilla/js/src/xpconnect/shell/xpcshell.cpp | 2 +-
 mozilla-1.9.2/mozilla/toolkit/xre/nsSigHandlers.cpp       | 2 +-
 mozilla-1.9.2/mozilla/xpcom/base/nsTraceRefcntImpl.cpp    | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/mozilla-1.9.2/mozilla/js/src/xpconnect/shell/xpcshell.cpp b/mozilla-1.9.2/mozilla/js/src/xpconnect/shell/xpcshell.cpp
index 99ee4f8..7783448 100644
--- a/mozilla-1.9.2/mozilla/js/src/xpconnect/shell/xpcshell.cpp
+++ b/mozilla-1.9.2/mozilla/js/src/xpconnect/shell/xpcshell.cpp
@@ -267,7 +267,7 @@ GetLine(JSContext *cx, char *bufp, FILE *file, const char *prompt) {
 #endif
     {
         char line[256];
-        fprintf(gOutFile, prompt);
+        fprintf(gOutFile, "%s", prompt);
         fflush(gOutFile);
         if (!fgets(line, sizeof line, file))
             return JS_FALSE;
diff --git a/mozilla-1.9.2/mozilla/toolkit/xre/nsSigHandlers.cpp b/mozilla-1.9.2/mozilla/toolkit/xre/nsSigHandlers.cpp
index b928d66..8e85cec 100644
--- a/mozilla-1.9.2/mozilla/toolkit/xre/nsSigHandlers.cpp
+++ b/mozilla-1.9.2/mozilla/toolkit/xre/nsSigHandlers.cpp
@@ -136,7 +136,7 @@ static void PrintStackFrame(void *aPC, void *aClosure)
 
   NS_DescribeCodeAddress(aPC, &details);
   NS_FormatCodeAddressDetails(aPC, &details, buf, sizeof(buf));
-  fprintf(stdout, buf);
+  fprintf(stdout, "%s", buf);
 }
 
 }
diff --git a/mozilla-1.9.2/mozilla/xpcom/base/nsTraceRefcntImpl.cpp b/mozilla-1.9.2/mozilla/xpcom/base/nsTraceRefcntImpl.cpp
index 032bbff..608ee3f 100644
--- a/mozilla-1.9.2/mozilla/xpcom/base/nsTraceRefcntImpl.cpp
+++ b/mozilla-1.9.2/mozilla/xpcom/base/nsTraceRefcntImpl.cpp
@@ -872,7 +872,7 @@ static void PrintStackFrame(void *aPC, void *aClosure)
 
   NS_DescribeCodeAddress(aPC, &details);
   NS_FormatCodeAddressDetails(aPC, &details, buf, sizeof(buf));
-  fprintf(stream, buf);
+  fprintf(stream, "%s", buf);
 }
 
 }