Fix format string bug (bug 377747). Not part of default builds.
authorjruderman@hmc.edu
Tue, 05 Jun 2007 18:22:25 -0700
changeset 2164 ee625ecdf7f7feb1463fee65055825d728070dcf
parent 2163 bbf2bc88c21bf0ef2e69c2531b574a2dfde136f2
child 2165 8284ac8c2c3f0243be9ef06686739c0fdb04e0d7
push id1
push userroot
push dateTue, 26 Apr 2011 22:38:44 +0000
treeherdermozilla-beta@bfdb6e623a36 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs377747
milestone1.9a6pre
Fix format string bug (bug 377747). Not part of default builds.
extensions/jssh/nsJSSh.cpp
--- a/extensions/jssh/nsJSSh.cpp
+++ b/extensions/jssh/nsJSSh.cpp
@@ -146,19 +146,19 @@ Print(JSContext *cx, JSObject *obj, uint
        if (shell->mEmitHeader) {
          char buf[80];
          sprintf(buf, "[%d]", JS_GetStringLength(str));
          shell->mOutput->Write(buf, strlen(buf), &bytesWritten);
        }
        shell->mOutput->Write(JS_GetStringBytes(str), JS_GetStringLength(str), &bytesWritten);
      }
      else
-       printf(JS_GetStringBytes(str)); // use cout if no output stream given.
+       printf("%s", JS_GetStringBytes(str)); // use cout if no output stream given.
 #ifdef DEBUG
-//        printf(JS_GetStringBytes(str));
+//        printf("%s", JS_GetStringBytes(str));
 #endif
    }
   return JS_TRUE;
 }
 
 JS_STATIC_DLL_CALLBACK(JSBool)
 Quit(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
 {