style: format kprintf_internal for improved readability
Co-authored-by: Copilot <copilot@github.com>
This commit is contained in:
parent
40333f1a37
commit
57a21bd4e2
2 changed files with 15 additions and 10 deletions
|
|
@ -137,7 +137,8 @@ void kprintf_internal(const char *format, va_list args)
|
||||||
if (*p == '%')
|
if (*p == '%')
|
||||||
{
|
{
|
||||||
p++;
|
p++;
|
||||||
if(*p == '\0') break;
|
if (*p == '\0')
|
||||||
|
break;
|
||||||
switch (*p)
|
switch (*p)
|
||||||
{
|
{
|
||||||
case 'c':
|
case 'c':
|
||||||
|
|
@ -149,7 +150,8 @@ void kprintf_internal(const char *format, va_list args)
|
||||||
case 's':
|
case 's':
|
||||||
{
|
{
|
||||||
char *s = va_arg(args, char *);
|
char *s = va_arg(args, char *);
|
||||||
if (!s) s = "(null)";
|
if (!s)
|
||||||
|
s = "(null)";
|
||||||
kprint(s);
|
kprint(s);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -2,5 +2,8 @@
|
||||||
#define STRING_H
|
#define STRING_H
|
||||||
|
|
||||||
void *memset(void *s, int c, size_t n);
|
void *memset(void *s, int c, size_t n);
|
||||||
|
void *memcpy(void *dest, const void *src, size_t n);
|
||||||
|
int strcmp(const char *str1, const char *str2);
|
||||||
|
size_t strlen(const char *s);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
Loading…
Add table
Add a link
Reference in a new issue