]> code.citadel.org Git - citadel.git/blobdiff - webcit/inetconf.c
fix source so that '-Wformat -Werror=format-security' doesn't stop us from compiling
[citadel.git] / webcit / inetconf.c
index c8e100d0a03af984a31888be70171f395c440530..b4470a7b2257eddf8d369acfda36a4e6c52eee74 100644 (file)
@@ -12,6 +12,7 @@ typedef enum _e_cfg {
        ic_localhost,
        ic_directory,
        ic_smarthost,
+       ic_fallback,
        ic_rbl,
        ic_spamass,
        ic_masq,
@@ -31,6 +32,7 @@ ConstStrBuf CfgNames[] = {
        { HKEY("localhost") },
        { HKEY("directory") },
        { HKEY("smarthost") },
+       { HKEY("fallbackhost") },
        { HKEY("rbl") },
        { HKEY("spamassassin") },
        { HKEY("masqdomain") },
@@ -67,7 +69,10 @@ void load_inetconf(void)
        if (GetServerStatus(Buf, NULL) == 1) {
                CfgToken = NewStrBuf();
                while ((len = StrBuf_ServGetln(Buf),
-                       strcmp(ChrPtr(Buf), "000"))) {
+                       ((len >= 0) && 
+                        ((len != 3) ||
+                         strcmp(ChrPtr(Buf), "000")))))
+               {
                        Value = NewStrBuf();
  
                        StrBufExtract_token(CfgToken, Buf, 1, '|');
@@ -204,7 +209,7 @@ HashList *GetInetConfHash(StrBuf *Target, WCTemplputParams *TP)
        if (WCC->InetCfg == NULL)
                load_inetconf();
        GetHash(WCC->InetCfg, TKEY(5), &vHash);
-       svprintf(HKEY("SERVCFG:INET:TYPE"), WCS_STRING, TP->Tokens->Params[5]->Start);
+       svprintf(HKEY("SERVCFG:INET:TYPE"), WCS_STRING, "%s", TP->Tokens->Params[5]->Start);
        return vHash;
 }
 
@@ -212,7 +217,7 @@ void
 InitModule_INETCONF
 (void)
 {
-       WebcitAddUrlHandler(HKEY("save_inetconf"), new_save_inetconf, 0);
+       WebcitAddUrlHandler(HKEY("save_inetconf"), "", 0, new_save_inetconf, 0);
        RegisterIterator("SERVCFG:INET", 1, NULL, GetInetConfHash, InetCfgSubst, NULL, CTX_INETCFG, CTX_NONE, IT_NOFLAG);
        RegisterNamespace("SERVCFG:FLUSHINETCFG",0, 0, DeleteInetConfHash, NULL, CTX_NONE);
 }