* trim() whitespaces from inetconf values on save; they don't make sense in neither...
authorWilfried Göesgens <willi@citadel.org>
Mon, 6 Jul 2009 21:17:55 +0000 (21:17 +0000)
committerWilfried Göesgens <willi@citadel.org>
Mon, 6 Jul 2009 21:17:55 +0000 (21:17 +0000)
webcit/inetconf.c

index 40966f24eb6284183f5f0c0bfe048d5c3b320123..e4f7254eddb688d1618bbf213e025427552b8d7f 100644 (file)
@@ -128,6 +128,7 @@ void new_save_inetconf(void) {
                FlushStrBuf(Str);       
        }
        else if (!strcasecmp(bstr("oper"), "add")) {
+               StrBuf *name;
                eName = sbstr("ename");
                if (eName == NULL) {
                        StrBufPrintf(WCC->ImportantMsg, _("Invalid Parameter"));
@@ -137,8 +138,9 @@ void new_save_inetconf(void) {
 
                nUsed = GetCount(Hash);
                nUsed = snprintf(nnn, sizeof(nnn), "%d", nUsed+1);
-       
-               Put(Hash, nnn, nUsed, NewStrBufDup(eName), HFreeStrBuf); 
+               name = NewStrBufDup(eName);
+               StrBufTrim(name);
+               Put(Hash, nnn, nUsed, name, HFreeStrBuf); 
                StrBufPrintf(WCC->ImportantMsg, "%s %s", 
                             /*<domain> added status message*/ _("added."), 
                             ChrPtr(eName));