diff options
author | Dima Zavin <dima@android.com> | 2009-05-05 18:33:07 -0700 |
---|---|---|
committer | Dima Zavin <dima@android.com> | 2009-05-05 18:35:00 -0700 |
commit | 770354d7e6cd471daed426fcf04bf7246e7cb18b (patch) | |
tree | 334d1d727af27b8f142a19115d32344bcc103b62 /init/init.h | |
parent | feb3d6d8db30f51c560e792ef3d9eca01d9cae9d (diff) | |
download | system_core-770354d7e6cd471daed426fcf04bf7246e7cb18b.zip system_core-770354d7e6cd471daed426fcf04bf7246e7cb18b.tar.gz system_core-770354d7e6cd471daed426fcf04bf7246e7cb18b.tar.bz2 |
init: Fix segfault when log_write() was missing an arg to format.
Also, flag log_write() as a printf-like beast to gcc.
Signed-off-by: Dima Zavin <dima@android.com>
Diffstat (limited to 'init/init.h')
-rw-r--r-- | init/init.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/init/init.h b/init/init.h index b686869..c9363da 100644 --- a/init/init.h +++ b/init/init.h @@ -29,7 +29,8 @@ void *read_file(const char *fn, unsigned *_sz); void log_init(void); void log_set_level(int level); void log_close(void); -void log_write(int level, const char *fmt, ...); +void log_write(int level, const char *fmt, ...) + __attribute__ ((format(printf, 2, 3))); #define ERROR(x...) log_write(3, "<3>init: " x) #define NOTICE(x...) log_write(5, "<5>init: " x) |