aboutsummaryrefslogtreecommitdiff
path: root/libs/libc/inc/print.h
diff options
context:
space:
mode:
authorMarvin Borner2021-04-01 19:39:14 +0200
committerMarvin Borner2021-04-01 19:39:14 +0200
commitafa00abb2b68205bee539d7947130d6b1b1ec6e9 (patch)
tree3a821a75af6c4d4ff1bd4128c4859d77abf87e66 /libs/libc/inc/print.h
parent4c168fb34c15a1b8981abef7ccef1542a6fb05ca (diff)
Hardened entire system
By using the nonnull attribute and replace buffer-overflow-prone functions like strcpy, strcat and sprintf by strlcpy, strlcat and snprintf.
Diffstat (limited to 'libs/libc/inc/print.h')
-rw-r--r--libs/libc/inc/print.h24
1 files changed, 12 insertions, 12 deletions
diff --git a/libs/libc/inc/print.h b/libs/libc/inc/print.h
index 58b5dc6..751a929 100644
--- a/libs/libc/inc/print.h
+++ b/libs/libc/inc/print.h
@@ -3,24 +3,24 @@
#ifndef PRINT_H
#define PRINT_H
-#include "arg.h"
+#include <arg.h>
#include <def.h>
-int printf(const char *format, ...);
-int vprintf(const char *format, va_list ap);
-int sprintf(char *str, const char *format, ...);
-int vsprintf(char *str, const char *format, va_list ap);
-int print(const char *str);
-NORETURN void panic(const char *format, ...);
+int printf(const char *format, ...) NONNULL;
+int vprintf(const char *format, va_list ap) NONNULL;
+int snprintf(char *str, u32 size, const char *format, ...) NONNULL;
+int vsnprintf(char *str, u32 size, const char *format, va_list ap) NONNULL;
+int print(const char *str) NONNULL;
+NORETURN void panic(const char *format, ...) NONNULL;
#ifdef userspace
-int vfprintf(const char *path, const char *format, va_list ap);
-int fprintf(const char *path, const char *format, ...);
-int log(const char *format, ...);
-int err(int code, const char *format, ...);
+int vfprintf(const char *path, const char *format, va_list ap) NONNULL;
+int fprintf(const char *path, const char *format, ...) NONNULL;
+int log(const char *format, ...) NONNULL;
+int err(int code, const char *format, ...) NONNULL;
#else
#include <proc.h>
-int print_app(enum stream_defaults id, const char *proc_name, const char *str);
+int print_app(enum stream_defaults id, const char *proc_name, const char *str) NONNULL;
void print_trace(u32 count);
#endif