diff options
Diffstat (limited to 'lib/cvthex.c')
-rw-r--r-- | lib/cvthex.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/lib/cvthex.c b/lib/cvthex.c index 5f3da19..8faf853 100644 --- a/lib/cvthex.c +++ b/lib/cvthex.c @@ -27,13 +27,14 @@ ** ** NOTE: assumes buf is large enough to hold the resulting string */ -int cvthex( char *buf, uint32_t value ) { +int cvthex(char *buf, uint32_t value) +{ const char hexdigits[] = "0123456789ABCDEF"; int chars_stored = 0; - for( int i = 0; i < 8; i += 1 ) { + for (int i = 0; i < 8; i += 1) { uint32_t val = value & 0xf0000000; - if( chars_stored || val != 0 || i == 7 ) { + if (chars_stored || val != 0 || i == 7) { ++chars_stored; val = (val >> 28) & 0xf; *buf++ = hexdigits[val]; @@ -43,7 +44,7 @@ int cvthex( char *buf, uint32_t value ) { *buf = '\0'; - return( chars_stored ); + return (chars_stored); } #endif |