From ebed17d9d09ac310b9de214b164faa5e40edc4cc Mon Sep 17 00:00:00 2001 From: Jason Volk Date: Thu, 1 Mar 2018 02:30:59 -0800 Subject: [PATCH] ircd: Fix error / simplify. --- ircd/lexical.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ircd/lexical.cc b/ircd/lexical.cc index c21b55eab..9ab5a21e7 100644 --- a/ircd/lexical.cc +++ b/ircd/lexical.cc @@ -666,10 +666,10 @@ ircd::u2a(const mutable_buffer &out, const const_buffer &in) { char *p(data(out)); - for(size_t i(0); i < size(in); ++i) - p += snprintf(p, size(out) - (p - data(out)), "%02x", in[i]); + for(size_t i(0); i < size(in); ++i, p += 2) + snprintf(p, end(out) - p, "%02x", in[i]); - return { data(out), size_t(p - data(out)) }; + return { data(out), p }; } ircd::const_buffer