aboutsummaryrefslogtreecommitdiff
path: root/src/kernel/lib/stdlib/htoa.c
diff options
context:
space:
mode:
authorMarvin Borner2020-03-18 17:32:50 +0100
committerMarvin Borner2020-03-18 17:32:50 +0100
commitf495cc1e93710c233292a503720ec235a61b685c (patch)
tree23b0b4b82b6d80001c1ffdb15f00b93cbdc65722 /src/kernel/lib/stdlib/htoa.c
parentc6657aac0c5d5ecf347bc082cb6df38e1174d297 (diff)
Applied official linux kernel code style guidelines
Due to my change to vim and the clang-format plugin this was needed!
Diffstat (limited to 'src/kernel/lib/stdlib/htoa.c')
-rw-r--r--src/kernel/lib/stdlib/htoa.c33
1 files changed, 17 insertions, 16 deletions
diff --git a/src/kernel/lib/stdlib/htoa.c b/src/kernel/lib/stdlib/htoa.c
index 49ca703..ee639ec 100644
--- a/src/kernel/lib/stdlib/htoa.c
+++ b/src/kernel/lib/stdlib/htoa.c
@@ -6,25 +6,26 @@ static const char HTOA_TABLE[] = "0123456789ABCDEF";
char *htoa(uint32_t n)
{
- char *ret = (char *) kmalloc(10);
+ char *ret = (char *)kmalloc(10);
- int i = 0;
- while (n) {
- ret[i++] = HTOA_TABLE[n & 0xF];
- n >>= 4;
- }
+ int i = 0;
+ while (n) {
+ ret[i++] = HTOA_TABLE[n & 0xF];
+ n >>= 4;
+ }
- if (!i) {
- ret[0] = '0';
- i++;
- }
+ if (!i) {
+ ret[0] = '0';
+ i++;
+ }
- for (; i <= 9; i++) ret[i] = 0;
+ for (; i <= 9; i++)
+ ret[i] = 0;
- char *aux = strdup(ret);
- kfree(ret);
- ret = aux;
+ char *aux = strdup(ret);
+ kfree(ret);
+ ret = aux;
- strinv(ret);
- return ret;
+ strinv(ret);
+ return ret;
} \ No newline at end of file