]> code.citadel.org Git - citadel.git/blobdiff - webcit/iconbar.c
* added GCC Format String checkers to the remaining printf alikes
[citadel.git] / webcit / iconbar.c
index fe9699816cca66ff26f7470c15904615979dfe8b..981e2c9287eb8ed1f201d144b6c2cef192d39bfc 100644 (file)
@@ -27,7 +27,7 @@ void do_selected_iconbar(void) {
 
 void DontDeleteThis(void *Data){};
 
-#define IconbarIsEnabled(a, b) IconbarIsENABLED(a, sizeof(a), b)
+#define IconbarIsEnabled(a, b) IconbarIsENABLED(a, sizeof(a) - 1, b)
 
 long IconbarIsENABLED(const char *key, size_t keylen, long defval)
 {
@@ -42,14 +42,14 @@ long IconbarIsENABLED(const char *key, size_t keylen, long defval)
 static char nbuf[32];
 inline const char *PrintInt(void *Prefstr)
 {
-       snprintf(nbuf, sizeof(nbuf), "%ld", Prefstr);
+       snprintf(nbuf, sizeof(nbuf), "%ld", (long)Prefstr);
        return nbuf;
 }
 
 void LoadIconSettings(void)
 {
        struct wcsession *WCC = WC;
-       StrBuf *iconbar;
+       StrBuf *iconbar = NULL;
        StrBuf *buf = NewStrBuf();;
        StrBuf *key = NewStrBuf();
        long val;
@@ -88,10 +88,10 @@ void LoadIconSettings(void)
  * \brief draw the icon bar???
  */
 void do_iconbar(void) {
-       int ib_displayas = 0;   /**< pictures and text, pictures, text */
+       int ib_displayas = IB_PICTEXT;  /**< pictures and text, pictures, text */
 
        LoadIconSettings();
-       ib_displayas = IconbarIsEnabled("ib_displayas", 0);
+       ib_displayas = IconbarIsEnabled("ib_displayas", IB_PICTEXT);
 
 /** Site logo */
        if (IconbarIsEnabled("ib_logo", 0)) {
@@ -386,7 +386,7 @@ void do_iconbar_roomlist(void) {
 
        LoadIconSettings();
 
-       ib_displayas = IconbarIsEnabled("ib_displayas", 0);     /* pictures and text, pictures, text */
+       ib_displayas = IconbarIsEnabled("ib_displayas", IB_PICTEXT);    /* pictures and text, pictures, text */
 
 /** Site logo */
        if (IconbarIsEnabled("ib_logo", 0)) {