From 8a4f8d202298a4d4219b7e892f3fdc86226cf1db Mon Sep 17 00:00:00 2001 From: Inaky Perez-Gonzalez Date: Wed, 26 May 2010 12:49:22 -0700 Subject: [PATCH] storage: add printf-like verification Add __attribute__((format)) to {write, read}_file() --- src/storage.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/storage.h b/src/storage.h index d74de359..74cbba5a 100644 --- a/src/storage.h +++ b/src/storage.h @@ -30,10 +30,12 @@ int create_dirs(const char *filename, const mode_t mode); ssize_t read_file(unsigned char *buffer, size_t len, - const char *path_fmt, ...); + const char *path_fmt, ...) + __attribute__((format(printf, 3, 4))); ssize_t write_file(const unsigned char *buffer, size_t len, mode_t mode, - const char *path_fmt, ...); + const char *path_fmt, ...) + __attribute__((format(printf, 4, 5))); GKeyFile *storage_open(const char *imsi, const char *store); void storage_sync(const char *imsi, const char *store, GKeyFile *keyfile);