Skip to content

Commit 5aa296f

Browse files
committed
Expand macro in case where string cannot be initialized to 0
1 parent 3bee984 commit 5aa296f

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

include/rapidjson/obj.h

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1331,7 +1331,19 @@ bool ObjPropertyType::read(std::istream& in) {
13311331
in >> std::skipws;
13321332
return true;
13331333
}
1334-
else RAPIDJSON_HANDLE_PROPERTY_TYPES_SPECIAL_(HANDLE_VECTOR_READ_)
1334+
// Do this explicitly because string can't be initialized with 0
1335+
// else RAPIDJSON_HANDLE_PROPERTY_TYPES_SPECIAL_(HANDLE_VECTOR_READ_)
1336+
else if (second & ObjTypeCurve) {
1337+
HANDLE_VECTOR_READ_(T, ObjRefCurve);
1338+
} else if (second & ObjTypeSurface) {
1339+
HANDLE_VECTOR_READ_(T, ObjRefSurface);
1340+
} else if (second & ObjTypeString) {
1341+
std::vector<std::string>* val = (std::vector<std::string>*)mem;
1342+
std::string x = 0;
1343+
while ((in.peek() != '\n') && (in >> x))
1344+
val->push_back(x);
1345+
return true;
1346+
}
13351347
else RAPIDJSON_HANDLE_PROPERTY_TYPES_(HANDLE_VECTOR_READ_)
13361348
}
13371349
else RAPIDJSON_HANDLE_PROPERTY_TYPES_SPECIAL_(HANDLE_SCALAR_READ_)

0 commit comments

Comments
 (0)