diff options
| author | Kimplul <kimi.h.kuparinen@gmail.com> | 2021-09-18 22:32:15 +0300 |
|---|---|---|
| committer | Kimplul <kimi.h.kuparinen@gmail.com> | 2021-09-19 13:57:57 +0300 |
| commit | 605c7d9258c129b66b76f1b55a8a6f3cea68c13e (patch) | |
| tree | 22bd4fad07791d0bb514e711a3c5e185eed586a0 /common | |
| parent | d95c714c8cfdc5818b0e0f0c99cf2e5be66de202 (diff) | |
| download | kmi-605c7d9258c129b66b76f1b55a8a6f3cea68c13e.tar.gz kmi-605c7d9258c129b66b76f1b55a8a6f3cea68c13e.zip | |
Added fdt debug capability
+ For future reference, apos now requires initrd to be found in fdt.
Diffstat (limited to 'common')
| -rw-r--r-- | common/debug.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/common/debug.c b/common/debug.c index 9925bd6..c82377c 100644 --- a/common/debug.c +++ b/common/debug.c @@ -154,7 +154,7 @@ static size_t __integral_val(ssize_t value, size_t base, size_t flags, bool prin #undef handle_type if(base == 16) - c += c >= 9 ? 'a' - 10 : '0'; + c += c > 9 ? 'a' - 10 : '0'; else c += '0'; @@ -430,6 +430,7 @@ void dbg(const char *fmt, ...) /* read actual specifier */ size_t base = 10; size_t value = 0; + int i = -1; const char *s = 0; void *p = 0; int *n = 0; @@ -486,7 +487,11 @@ void dbg(const char *fmt, ...) case 's': s = va_arg(vl, const char *); - for(; *s ;){ + + if(__is_set(flags, PRECS_FLAG)) + i = precision; + + for(; *s && i--;){ __putchar(*s++); chars_written++; } |
