summaryrefslogtreecommitdiffstats
path: root/src/common/escape.cc
diff options
context:
space:
mode:
authorPatrick Donnelly <pdonnell@redhat.com>2018-01-24 20:26:42 +0100
committerPatrick Donnelly <pdonnell@redhat.com>2018-02-07 15:40:46 +0100
commit43af5afca678a483db085ceb5b0c1778881740a8 (patch)
treefca0621925342f41bebe45a9ebfc52e20c0dedec /src/common/escape.cc
parentmds: convert to allocator agnostic string_view (diff)
downloadceph-43af5afca678a483db085ceb5b0c1778881740a8.tar.xz
ceph-43af5afca678a483db085ceb5b0c1778881740a8.zip
common: use size_t for object size
Signed-off-by: Patrick Donnelly <pdonnell@redhat.com>
Diffstat (limited to 'src/common/escape.cc')
-rw-r--r--src/common/escape.cc13
1 files changed, 6 insertions, 7 deletions
diff --git a/src/common/escape.cc b/src/common/escape.cc
index 78659b0bfb2..4e6b7f7f66a 100644
--- a/src/common/escape.cc
+++ b/src/common/escape.cc
@@ -32,10 +32,10 @@
#define SGL_QUOTE_XESCAPE "&apos;"
#define DBL_QUOTE_XESCAPE "&quot;"
-int escape_xml_attr_len(const char *buf)
+size_t escape_xml_attr_len(const char *buf)
{
const char *b;
- int ret = 0;
+ size_t ret = 0;
for (b = buf; *b; ++b) {
unsigned char c = *b;
switch (c) {
@@ -173,11 +173,10 @@ std::ostream& operator<<(std::ostream& out, const xml_stream_escaper& e)
#define TAB_JESCAPE "\\t"
#define NEWLINE_JESCAPE "\\n"
-int escape_json_attr_len(const char *buf, int src_len)
+size_t escape_json_attr_len(const char *buf, size_t src_len)
{
const char *b;
- int ret = 0;
- int i;
+ size_t i, ret = 0;
for (i = 0, b = buf; i < src_len; ++i, ++b) {
unsigned char c = *b;
switch (c) {
@@ -208,11 +207,11 @@ int escape_json_attr_len(const char *buf, int src_len)
return ret;
}
-void escape_json_attr(const char *buf, int src_len, char *out)
+void escape_json_attr(const char *buf, size_t src_len, char *out)
{
char *o = out;
const char *b;
- int i;
+ size_t i;
for (i = 0, b = buf; i < src_len; ++i, ++b) {
unsigned char c = *b;
switch (c) {