#include <string.h>
#include <assert.h>
-#include <jansson.h>
+#include "jansson.h"
#include "jansson_private.h"
#include "strbuffer.h"
#include "utf.h"
va_start(ap, msg);
vsnprintf(msg_text, JSON_ERROR_TEXT_LENGTH, msg, ap);
+ msg_text[JSON_ERROR_TEXT_LENGTH - 1] = '\0';
va_end(ap);
if(lex)
if(lex->saved_text.length <= 20) {
snprintf(msg_with_context, JSON_ERROR_TEXT_LENGTH,
"%s near '%s'", msg_text, saved_text);
+ msg_with_context[JSON_ERROR_TEXT_LENGTH - 1] = '\0';
result = msg_with_context;
}
}
else {
snprintf(msg_with_context, JSON_ERROR_TEXT_LENGTH,
"%s near end of file", msg_text);
+ msg_with_context[JSON_ERROR_TEXT_LENGTH - 1] = '\0';
result = msg_with_context;
}
}
}
#if JSON_INTEGER_IS_LONG_LONG
+#ifdef _WIN32
+#define json_strtoint _strtoi64
+#else
#define json_strtoint strtoll
+#endif
#else
#define json_strtoint strtol
#endif