diff --git a/geojson-loop.cpp b/geojson-loop.cpp index e4f2f40b..5d620940 100644 --- a/geojson-loop.cpp +++ b/geojson-loop.cpp @@ -12,6 +12,7 @@ #include #include "geojson-loop.hpp" #include "jsonpull/jsonpull.h" +#include "text.hpp" // XXX duplicated #define GEOM_TYPES 6 @@ -29,7 +30,7 @@ static void json_context(json_object *j) { std::string s = json_stringify(j); if (s.size() >= 500) { - s.resize(497); + s = truncate_string(s, 497); s.append("..."); } diff --git a/read_json.cpp b/read_json.cpp index ec0b1cfd..725d7226 100644 --- a/read_json.cpp +++ b/read_json.cpp @@ -46,7 +46,7 @@ void json_context(json_object *j) { std::string s = json_stringify(j); if (s.size() >= 500) { - s.resize(497); + s = truncate_string(s, 497); s.append("..."); }