From bfc53136c8fbea59f116d8d0de92b2711f7804c0 Mon Sep 17 00:00:00 2001 From: Jari Vetoniemi Date: Sat, 12 Apr 2014 20:21:40 +0300 Subject: [PATCH] Add print attribute and fix warning it catched. --- lib/draw/curses.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/draw/curses.c b/lib/draw/curses.c index 3b99cd9..656e47d 100644 --- a/lib/draw/curses.c +++ b/lib/draw/curses.c @@ -101,6 +101,9 @@ static int _bmDrawCursesResizeBuffer(char **buffer, size_t osize, size_t nsize) return 1; } +#if __GNUC__ +__attribute__((format(printf, 3, 4))) +#endif static void _bmDrawCursesDrawLine(int pair, int y, const char *format, ...) { static int blen = 0; @@ -178,8 +181,7 @@ static void _bmDrawCursesRender(const bmMenu *menu) const unsigned int lines = curses.getmaxy(curses.stdscr); curses.erase(); - size_t titleLen = (menu->title ? strlen(menu->title) + 1 : 0); - + int titleLen = (menu->title ? strlen(menu->title) + 1 : 0); _bmDrawCursesDrawLine(0, 0, "%*s%s", titleLen, "", menu->filter); if (menu->title) {