]> code.citadel.org Git - citadel.git/blobdiff - webcit/paramhandling.c
MAILINGLIST: add facility to choose the default room email alias.
[citadel.git] / webcit / paramhandling.c
index 46ac87280e970bb90976bd4dbd4932511c929194..f5cc22bbc3faefbd0b19e27b3223395d6f1708c0 100644 (file)
@@ -50,7 +50,7 @@ void ParseURLParams(StrBuf *url)
                        bptr++;
                }
                keylen = aptr - up - 1; /* -1 -> '=' */
-               if(keylen > sizeof(u->url_key)) {
+               if(keylen >= sizeof(u->url_key)) {
                        syslog(1, "invalid url_key from %s", ChrPtr(WCC->Hdr->HR.browser_host));
                        return;
                }
@@ -318,7 +318,7 @@ void upload_handler(char *name, char *filename, char *partnum, char *disp,
        long keylen;
 
 #ifdef DEBUG_URLSTRINGS
-       syslog(9, "upload_handler() name=%s, type=%s, len=%d", name, cbtype, length);
+       syslog(9, "upload_handler() name=%s, type=%s, len="SIZE_T_FMT, name, cbtype, length);
 #endif
        if (WCC->Hdr->urlstrings == NULL)
                WCC->Hdr->urlstrings = NewHash(1, NULL);
@@ -364,14 +364,12 @@ void upload_handler(char *name, char *filename, char *partnum, char *disp,
 
 }
 
-
-
 void PutBstr(const char *key, long keylen, StrBuf *Value)
 {
        urlcontent *u;
        wcsession *WCC = WC;
 
-       if(keylen > sizeof(u->url_key)) {
+       if(keylen >= sizeof(u->url_key)) {
                syslog(1, "invalid url_key from %s", ChrPtr(WCC->Hdr->HR.browser_host));
                FreeStrBuf(&Value);
                return;
@@ -381,6 +379,14 @@ void PutBstr(const char *key, long keylen, StrBuf *Value)
        u->url_data = Value;
        Put(WC->Hdr->urlstrings, u->url_key, keylen, u, free_url);
 }
+void PutlBstr(const char *key, long keylen, long Value)
+{
+       StrBuf *Buf;
+
+       Buf = NewStrBufPlain(NULL, sizeof(long) * 16);
+       StrBufPrintf(Buf, "%ld", Value);
+       PutBstr(key, keylen, Buf);
+}