diff options
author | Dima Zavin <dima@android.com> | 2009-05-05 20:36:35 -0700 |
---|---|---|
committer | The Android Open Source Project <initial-contribution@android.com> | 2009-05-05 20:36:35 -0700 |
commit | 06c6589b1078a73ce25680f951356b1075418441 (patch) | |
tree | 4d79acbc25e099efff526f56d6255bfbc1a02027 | |
parent | 9b3174477d27ec2babb9feb3f5ca7ef92b4f1d9c (diff) | |
parent | 770354d7e6cd471daed426fcf04bf7246e7cb18b (diff) | |
download | system_core-06c6589b1078a73ce25680f951356b1075418441.zip system_core-06c6589b1078a73ce25680f951356b1075418441.tar.gz system_core-06c6589b1078a73ce25680f951356b1075418441.tar.bz2 |
am 770354d: init: Fix segfault when log_write() was missing an arg to fo
Merge commit '770354d7e6cd471daed426fcf04bf7246e7cb18b'
* commit '770354d7e6cd471daed426fcf04bf7246e7cb18b':
init: Fix segfault when log_write() was missing an arg to format.
-rw-r--r-- | init/init.c | 2 | ||||
-rw-r--r-- | init/init.h | 3 |
2 files changed, 3 insertions, 2 deletions
diff --git a/init/init.c b/init/init.c index 1630155..283608c 100644 --- a/init/init.c +++ b/init/init.c @@ -423,7 +423,7 @@ static void msg_stop(const char *name) if (svc) { service_stop(svc); } else { - ERROR("no such service '%s'\n"); + ERROR("no such service '%s'\n", name); } } 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) |