Skip to content

Commit d81c0b3

Browse files
authored
Merge pull request #46 from SinghRajenM/src_FixedIssue_20181209
Fixed issue
2 parents 9b8b3e8 + 5bce57c commit d81c0b3

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

NppJSONViewer/TreeBuilder.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,14 +43,14 @@ const char* FALSE_STR = "false";
4343

4444
bool TreeBuilder::Null()
4545
{
46-
return this->String(NULL_STR, sizeof(NULL_STR), true);
46+
return this->String(NULL_STR, static_cast<SizeType>(strlen(NULL_STR)), true);
4747
}
4848

4949
bool TreeBuilder::Bool(bool b)
5050
{
5151
if (b)
52-
return this->String(TRUE_STR, sizeof(TRUE_STR), true);
53-
return this->String(FALSE_STR, sizeof(FALSE_STR), true);
52+
return this->String(TRUE_STR, static_cast<SizeType>(strlen(TRUE_STR)), true);
53+
return this->String(FALSE_STR, static_cast<SizeType>(strlen(FALSE_STR)), true);
5454
}
5555

5656
bool TreeBuilder::Int(int i) { cout << "Int(" << i << ")" << endl; return true; }

NppJSONViewer/utils.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
#include <string>
44
#include <Shlwapi.h>
55

6-
#define SSTR( x ) static_cast< std::ostringstream & >( \
7-
( std::ostringstream() << std::dec << x ) ).str()
6+
template<typename T>
7+
constexpr auto SSTR(T x) { return (std::ostringstream() << std::dec << x).str(); }
88

99
EXTERN_C IMAGE_DOS_HEADER __ImageBase;
1010

0 commit comments

Comments
 (0)