common/printf.c: Format with clang-format
BRANCH=none
TEST=none
@@ -62,12 +62,11 @@ static int hexdigit(int c)
* Print the buffer as a string of bytes in hex.
* Returns 0 on success or an error on failure.
*/
-static int print_hex_buffer(int (*addchar)(void *context, int c),
- void *context, const char *vstr, int precision,
- int pad_width, int flags)
+static int print_hex_buffer(int (*addchar)(void *context, int c), void *context,
+ const char *vstr, int precision, int pad_width,
+ int flags)
{
-
/*
* Divide pad_width instead of multiplying precision to avoid overflow
* error in the condition. The "/2" and "2*" can be optimized by
@@ -270,8 +269,8 @@ int vfnprintf(int (*addchar)(void *context, int c), void *context,
* Avoid null pointer dereference for %ph and
* %pb. %pT and %pP can accept null.
*/
- if (ptrval == NULL
- && ptrspec != 'T' && ptrspec != 'P')
+ if (ptrval == NULL && ptrspec != 'T' &&
+ ptrspec != 'P')
continue;
/* %pT - print a timestamp. */
if (ptrspec == 'T' &&
@@ -298,11 +297,9 @@ int vfnprintf(int (*addchar)(void *context, int c), void *context,
ptrval;
int rc;
- rc = print_hex_buffer(addchar,
- context,
+ rc = print_hex_buffer(addchar, context,
hexbuf->buffer,
- hexbuf->size,
- 0,
+ hexbuf->size, 0,
0);
if (rc != EC_SUCCESS)
@@ -443,7 +440,6 @@ int vfnprintf(int (*addchar)(void *context, int c), void *context,
vlen = strnlen(vstr, precision);
}
-
while (vlen < pad_width && !(flags & PF_LEFT)) {
if (addchar(context, flags & PF_PADZERO ? '0' : ' '))
return EC_ERROR_OVERFLOW;
