X-Git-Url: https://git.notmuchmail.org/git?p=notmuch;a=blobdiff_plain;f=util%2Fhex-escape.c;h=81534a8cb95f0faec19a3661f98e9bd7ecde9f00;hp=b4a2a02aebd825e7d19f19ffb2120690818cb665;hb=HEAD;hpb=f5db7ad7d243785c274a99734c681e69d13313d0 diff --git a/util/hex-escape.c b/util/hex-escape.c index b4a2a02a..81534a8c 100644 --- a/util/hex-escape.c +++ b/util/hex-escape.c @@ -13,7 +13,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see http://www.gnu.org/licenses/ . + * along with this program. If not, see https://www.gnu.org/licenses/ . * * Author: David Bremner */ @@ -72,7 +72,7 @@ hex_encode (void *ctx, const char *in, char **out, size_t *out_size) if (*out == NULL) *out_size = 0; - if (!maybe_realloc (ctx, needed, out, out_size)) + if (! maybe_realloc (ctx, needed, out, out_size)) return HEX_OUT_OF_MEMORY; q = *out; @@ -82,7 +82,7 @@ hex_encode (void *ctx, const char *in, char **out, size_t *out_size) if (is_output (*p)) { *q++ = *p++; } else { - sprintf (q, "%%%02x", (unsigned char)*p++); + sprintf (q, "%%%02x", (unsigned char) *p++); q += 3; } } @@ -105,8 +105,8 @@ hex_decode_internal (const char *in, unsigned char *out) char *endp; /* This also handles unexpected end-of-string. */ - if (!isxdigit ((unsigned char) in[1]) || - !isxdigit ((unsigned char) in[2])) + if (! isxdigit ((unsigned char) in[1]) || + ! isxdigit ((unsigned char) in[2])) return HEX_SYNTAX_ERROR; buf[0] = in[1]; @@ -139,10 +139,10 @@ hex_decode_inplace (char *s) } hex_status_t -hex_decode (void *ctx, const char *in, char **out, size_t * out_size) +hex_decode (void *ctx, const char *in, char **out, size_t *out_size) { const char *p; - size_t needed = 1; /* for the NUL */ + size_t needed = 1; /* for the NUL */ assert (ctx); assert (in); assert (out); assert (out_size); @@ -152,7 +152,7 @@ hex_decode (void *ctx, const char *in, char **out, size_t * out_size) else needed += 1; - if (!maybe_realloc (ctx, needed, out, out_size)) + if (! maybe_realloc (ctx, needed, out, out_size)) return HEX_OUT_OF_MEMORY; return hex_decode_internal (in, (unsigned char *) *out);