Bug 1232113 - "Make the format specifiers in JS_snprintf() invocations more portable". r=nicolas.b.pierron

This commit is contained in:
Wei Wu 2015-12-12 19:59:00 +01:00
Родитель 09f75592c2
Коммит 35ff45f65f
1 изменённых файлов: 3 добавлений и 2 удалений

Просмотреть файл

@ -12,6 +12,7 @@
#include "mozilla/GuardObjects.h"
#include "mozilla/mozalloc.h"
#include "mozilla/PodOperations.h"
#include "mozilla/SizePrintfMacros.h"
#ifdef XP_WIN
# include <direct.h>
@ -1420,9 +1421,9 @@ Evaluate(JSContext* cx, unsigned argc, Value* vp)
if (loadBytecode && assertEqBytecode) {
if (saveLength != loadLength) {
char loadLengthStr[16];
JS_snprintf(loadLengthStr, sizeof(loadLengthStr), "%u", loadLength);
JS_snprintf(loadLengthStr, sizeof(loadLengthStr), "%" PRIu32, loadLength);
char saveLengthStr[16];
JS_snprintf(saveLengthStr, sizeof(saveLengthStr), "%u", saveLength);
JS_snprintf(saveLengthStr, sizeof(saveLengthStr), "%" PRIu32, saveLength);
JS_ReportErrorNumber(cx, my_GetErrorMessage, nullptr, JSSMSG_CACHE_EQ_SIZE_FAILED,
loadLengthStr, saveLengthStr);