|
@@ -30,9 +30,14 @@
|
|
|
#include <kernel/graphic.h>
|
|
#include <kernel/graphic.h>
|
|
|
#include <kernel/vsprintf.h>
|
|
#include <kernel/vsprintf.h>
|
|
|
|
|
|
|
|
|
|
+#include <lib/string.h>
|
|
|
|
|
+
|
|
|
#include <stdarg.h>
|
|
#include <stdarg.h>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
+static char buffer[256];
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
int printk(__uint32_t fg, __uint32_t bg, char *s, ...) {
|
|
int printk(__uint32_t fg, __uint32_t bg, char *s, ...) {
|
|
|
va_list args;
|
|
va_list args;
|
|
|
int i;
|
|
int i;
|
|
@@ -43,14 +48,14 @@ int printk(__uint32_t fg, __uint32_t bg, char *s, ...) {
|
|
|
if (s[255])
|
|
if (s[255])
|
|
|
return 0;
|
|
return 0;
|
|
|
|
|
|
|
|
- static char buffer[256] = {0};
|
|
|
|
|
-
|
|
|
|
|
va_start(args, s);
|
|
va_start(args, s);
|
|
|
|
|
|
|
|
/* it maybe overflow, but that's in .data section and we did check. */
|
|
/* it maybe overflow, but that's in .data section and we did check. */
|
|
|
|
|
|
|
|
i = vsprintf(buffer, s, args);
|
|
i = vsprintf(buffer, s, args);
|
|
|
print(fg, bg, buffer);
|
|
print(fg, bg, buffer);
|
|
|
|
|
+
|
|
|
|
|
+ memset(buffer, 0, 256);
|
|
|
|
|
|
|
|
va_end(args);
|
|
va_end(args);
|
|
|
|
|
|