Skip to content

Commit ce19001

Browse files
committed
require length
Ugh! I meant to do this long ago. It would have caught my blunder.
1 parent 078f991 commit ce19001

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

src/lib_json/json_value.cpp

+1-7
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,6 @@ const LargestInt Value::minLargestInt = LargestInt(~(LargestUInt(-1) / 2));
5252
const LargestInt Value::maxLargestInt = LargestInt(LargestUInt(-1) / 2);
5353
const LargestUInt Value::maxLargestUInt = LargestUInt(-1);
5454

55-
/// Unknown size marker
56-
static const size_t unknown = (size_t)-1;
57-
5855
#if !defined(JSON_USE_INT64_DOUBLE_CONVERSION)
5956
template <typename T, typename U>
6057
static inline bool InRange(double d, T min, U max) {
@@ -83,10 +80,7 @@ static inline bool InRange(double d, T min, U max) {
8380
* @return Pointer on the duplicate instance of string.
8481
*/
8582
static inline char* duplicateStringValue(const char* value,
86-
size_t length = unknown) {
87-
if (length == unknown)
88-
length = strlen(value);
89-
83+
size_t length) {
9084
// Avoid an integer overflow in the call to malloc below by limiting length
9185
// to a sane value.
9286
if (length >= (size_t)Value::maxInt)

0 commit comments

Comments
 (0)