summaryrefslogtreecommitdiff
path: root/src/common/ceph_json.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/common/ceph_json.cc')
-rw-r--r--src/common/ceph_json.cc4
1 files changed, 1 insertions, 3 deletions
diff --git a/src/common/ceph_json.cc b/src/common/ceph_json.cc
index 84355575c6c..a48e0636fcf 100644
--- a/src/common/ceph_json.cc
+++ b/src/common/ceph_json.cc
@@ -222,9 +222,7 @@ bool JSONParser::parse(const char *buf_, int len)
return false;
}
- string json_string = buf_;
- // make a substring to len
- json_string = json_string.substr(0, len);
+ string json_string(buf_, len);
success = read(json_string, data);
if (success)
handle_value(data);