Skip to content

Commit 8214f71

Browse files
authored
Fix typo in JSONCPP_USE_SECURE_MEMORY vs JSONCPP_USING_SECURE_MEMORY (#1567)
1 parent 07e3d1b commit 8214f71

File tree

6 files changed

+9
-9
lines changed

6 files changed

+9
-9
lines changed

include/json/config.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ using LargestUInt = UInt64;
127127

128128
template <typename T>
129129
using Allocator =
130-
typename std::conditional<JSONCPP_USING_SECURE_MEMORY, SecureAllocator<T>,
130+
typename std::conditional<JSONCPP_USE_SECURE_MEMORY, SecureAllocator<T>,
131131
std::allocator<T>>::type;
132132
using String = std::basic_string<char, std::char_traits<char>, Allocator<char>>;
133133
using IStringStream =

include/json/value.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -375,7 +375,7 @@ class JSON_API Value {
375375
int compare(const Value& other) const;
376376

377377
const char* asCString() const; ///< Embedded zeroes could cause you trouble!
378-
#if JSONCPP_USING_SECURE_MEMORY
378+
#if JSONCPP_USE_SECURE_MEMORY
379379
unsigned getCStringLength() const; // Allows you to understand the length of
380380
// the CString
381381
#endif

include/json/version.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
(JSONCPP_VERSION_PATCH << 8))
2020

2121
#if !defined(JSONCPP_USE_SECURE_MEMORY)
22-
#define JSONCPP_USING_SECURE_MEMORY 0
22+
#define JSONCPP_USE_SECURE_MEMORY 0
2323
#endif
2424
// If non-zero, the library zeroes any memory that it has allocated before
2525
// it frees its memory.

src/lib_json/json_value.cpp

+4-4
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ inline static void decodePrefixedString(bool isPrefixed, char const* prefixed,
165165
/** Free the string duplicated by
166166
* duplicateStringValue()/duplicateAndPrefixStringValue().
167167
*/
168-
#if JSONCPP_USING_SECURE_MEMORY
168+
#if JSONCPP_USE_SECURE_MEMORY
169169
static inline void releasePrefixedStringValue(char* value) {
170170
unsigned length = 0;
171171
char const* valueDecoded;
@@ -180,10 +180,10 @@ static inline void releaseStringValue(char* value, unsigned length) {
180180
memset(value, 0, size);
181181
free(value);
182182
}
183-
#else // !JSONCPP_USING_SECURE_MEMORY
183+
#else // !JSONCPP_USE_SECURE_MEMORY
184184
static inline void releasePrefixedStringValue(char* value) { free(value); }
185185
static inline void releaseStringValue(char* value, unsigned) { free(value); }
186-
#endif // JSONCPP_USING_SECURE_MEMORY
186+
#endif // JSONCPP_USE_SECURE_MEMORY
187187

188188
} // namespace Json
189189

@@ -601,7 +601,7 @@ const char* Value::asCString() const {
601601
return this_str;
602602
}
603603

604-
#if JSONCPP_USING_SECURE_MEMORY
604+
#if JSONCPP_USE_SECURE_MEMORY
605605
unsigned Value::getCStringLength() const {
606606
JSON_ASSERT_MESSAGE(type() == stringValue,
607607
"in Json::Value::asCString(): requires stringValue");

src/test_lib_json/jsontest.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -410,7 +410,7 @@ Json::String ToJsonString(const char* toConvert) {
410410

411411
Json::String ToJsonString(Json::String in) { return in; }
412412

413-
#if JSONCPP_USING_SECURE_MEMORY
413+
#if JSONCPP_USE_SECURE_MEMORY
414414
Json::String ToJsonString(std::string in) {
415415
return Json::String(in.data(), in.data() + in.length());
416416
}

src/test_lib_json/jsontest.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ TestResult& checkEqual(TestResult& result, T expected, U actual,
185185

186186
Json::String ToJsonString(const char* toConvert);
187187
Json::String ToJsonString(Json::String in);
188-
#if JSONCPP_USING_SECURE_MEMORY
188+
#if JSONCPP_USE_SECURE_MEMORY
189189
Json::String ToJsonString(std::string in);
190190
#endif
191191

0 commit comments

Comments
 (0)