From 1f83c92da094e0cf966b6a04cad400e25797cada Mon Sep 17 00:00:00 2001 From: Julian Barathieu Date: Tue, 14 May 2019 12:05:59 +0200 Subject: [PATCH] Minor style fix --- kaleid/libbuf/bprint.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/kaleid/libbuf/bprint.c b/kaleid/libbuf/bprint.c index 9283fa1..a3ccfec 100644 --- a/kaleid/libbuf/bprint.c +++ b/kaleid/libbuf/bprint.c @@ -78,7 +78,7 @@ static error_t bprinthash(Buffer_t *buf, int base, int cap) rc = bputc(buf, '0'); if (!rc && base != 8) { - rc = bputc(buf, (base==2 ? 'b' : (cap ? 'X' : 'x'))); + rc = bputc(buf, (base == 2 ? 'b' : (cap ? 'X' : 'x'))); } return rc; @@ -358,7 +358,10 @@ error_t vbprintf(Buffer_t *buf, const char *fmt, va_list ap) // Adjust width if (sgn && (plus || space)) width--; - else if (hash) width -= (base==8 ? 1 : ((base==2||base==16) ? 2 : 0)); + else if (hash) { + width -= (base == 8 ? 1 : + ((base == 2 || base == 16) ? 2 : 0)); + } // When padding with spaces, we pad before +/-'s etc if (!minus && !zero && width > len) @@ -375,9 +378,7 @@ error_t vbprintf(Buffer_t *buf, const char *fmt, va_list ap) if (zero && width > len) bdopadding(buf, width, len, '0'); - // // Output the actual number - // for (; !rc && *s ; s++) { rc = bputc(buf, (uchar)*s); } @@ -389,7 +390,7 @@ error_t vbprintf(Buffer_t *buf, const char *fmt, va_list ap) // Carry on to next modifier } - // Assert !rc for debugging purposes + // For debugging purposes assert(!rc); return rc;