Skip to content

Commit 83ad8b3

Browse files
committed
fixed GH pocoproject#138: FreeBSD JSON tests fail
1 parent 6184be0 commit 83ad8b3

4 files changed

Lines changed: 8 additions & 5 deletions

File tree

CHANGELOG

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,8 @@ Release 1.5.2 (2013-06-xx)
7575
- fixed GH #198: The "application.configDir" property is not always created.
7676
- fixed GH #185: Poco::NumberFormatter::format(double value, int precision)
7777
ignore precision == 0
78+
- fixed GH #138: FreeBSD JSON tests fail
79+
7880

7981
Release 1.5.1 (2013-01-11)
8082
==========================

Foundation/include/Poco/Platform_POSIX.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@
8181
// http://dbp-consulting.com/tutorials/SuppressingGCCWarnings.html
8282
// use example: GCC_DIAG_OFF(unused-variable)
8383
//
84-
#if defined(POCO_COMPILER_GCC) && (((__GNUC__ * 100) + __GNUC_MINOR__) >= 402)
84+
#if defined(POCO_COMPILER_GCC) && (((__GNUC__ * 100) + __GNUC_MINOR__) >= 460)
8585

8686
#ifdef GCC_DIAG_OFF
8787
#undef GCC_DIAG_OFF

Foundation/testsuite/src/UnicodeConverterTest.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,4 +91,5 @@ CppUnit::Test* UnicodeConverterTest::suite()
9191
}
9292

9393

94-
#endif
94+
#endif
95+

JSON/include/Poco/JSON/Parser.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -335,14 +335,14 @@ class JSON_API Parser
335335
unsigned char ch = static_cast<unsigned char>(CharTraits::to_char_type(nextChar));
336336

337337
// Determine the character's class.
338-
if (ch < 0 || (!_allowNullByte && ch == 0)) return false;
339-
if (0x80 <= ch && ch <= 0xFF)
338+
if ((!_allowNullByte && ch == 0)) return false;
339+
if (ch >= 0x80)
340340
{
341341
nextClass = C_ETC;
342342
CharIntType count = utf8CheckFirst(nextChar);
343343
if (!count)
344344
{
345-
throw Poco::JSON::JSONException(format("Unable to decode byte 0x%x", (unsigned int) nextChar));
345+
throw Poco::JSON::JSONException("Bad character.");
346346
}
347347

348348
char buffer[4];

0 commit comments

Comments
 (0)