Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.openwrt.org/project/libubox.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/ulog.h
diff options
context:
space:
mode:
authorKristupas Savickas <savickas.kristupas@gmail.com>2019-06-06 21:28:32 +0300
committerHauke Mehrtens <hauke@hauke-m.de>2019-06-16 17:29:47 +0300
commit9dd2dcff70c8e6a8af872d213dd53eff04d9c86a (patch)
tree301d3799057f6b5da683467707d2c148da191b5a /ulog.h
parenteeef7b50a06bc3c3218d560b4b513b4e7b19127f (diff)
libubox: add format string checking to ulog()
This offers an increased level of security, as the arguments will be checked for validity against the format string at compile time. The format attribute is supported by both GCC and Clang, so there shouldn't be any portability issues. Signed-off-by: Kristupas Savickas <savickas.kristupas@gmail.com>
Diffstat (limited to 'ulog.h')
-rw-r--r--ulog.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/ulog.h b/ulog.h
index 4818b1a..46d3c77 100644
--- a/ulog.h
+++ b/ulog.h
@@ -32,7 +32,8 @@ void ulog_close(void);
void ulog_threshold(int threshold);
-void ulog(int priority, const char *fmt, ...);
+void ulog(int priority, const char *fmt, ...)
+ __attribute__ ((format (printf, 2, 3)));
#define ULOG_INFO(fmt, ...) ulog(LOG_INFO, fmt, ## __VA_ARGS__)
#define ULOG_NOTE(fmt, ...) ulog(LOG_NOTICE, fmt, ## __VA_ARGS__)