From: Yehuda Sadeh Date: Fri, 8 Feb 2013 21:16:36 +0000 (-0800) Subject: rgw: plain format always appends eol to data X-Git-Tag: v0.57~23 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=c31aff5f9f0b9fe4ada6b259dd1f424627b3e875;p=ceph.git rgw: plain format always appends eol to data Beforehand we just prepended the eol to the next line, so that the last line also gets eol. Signed-off-by: Yehuda Sadeh --- diff --git a/src/rgw/rgw_formats.cc b/src/rgw/rgw_formats.cc index 61d4d04c7a4f..3a0dc76397ec 100644 --- a/src/rgw/rgw_formats.cc +++ b/src/rgw/rgw_formats.cc @@ -135,10 +135,7 @@ void RGWFormatter_Plain::dump_format(const char *name, const char *fmt, ...) va_start(ap, fmt); vsnprintf(buf, LARGE_SIZE, fmt, ap); va_end(ap); - if (len) - format = "\n%s"; - else - format = "%s"; + format = "%s\n"; write_data(format, buf); } @@ -233,11 +230,5 @@ void RGWFormatter_Plain::dump_value_int(const char *name, const char *fmt, ...) vsnprintf(buf, LARGE_SIZE, fmt, ap); va_end(ap); - const char *eol; - if (len) - eol = "\n"; - else - eol = ""; - - write_data("%s%s", eol, buf); + write_data("%s\n", buf); }