BSTR: add method to run-time add numbers
authorWilfried Goesgens <dothebart@citadel.org>
Sat, 27 Oct 2012 11:37:02 +0000 (13:37 +0200)
committerWilfried Goesgens <dothebart@citadel.org>
Sat, 27 Oct 2012 11:37:02 +0000 (13:37 +0200)
  - fix format warnings about wrong size of long

webcit/paramhandling.c
webcit/paramhandling.h
webcit/subst.c

index 9db69f7e78791ab4b7072958b0fa1d696c2626fb..f5cc22bbc3faefbd0b19e27b3223395d6f1708c0 100644 (file)
@@ -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,8 +364,6 @@ void upload_handler(char *name, char *filename, char *partnum, char *disp,
 
 }
 
-
-
 void PutBstr(const char *key, long keylen, StrBuf *Value)
 {
        urlcontent *u;
@@ -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);
+}
 
 
 
index cd1c16038d24e43a06f513536acfd045b245bf8f..87b0b1cec65ae1ff103aab804497f26930f7666d 100644 (file)
@@ -40,3 +40,6 @@ const char *Bstr(const char *key, size_t keylen);
 #define putbstr(a, b) PutBstr(a, sizeof(a) - 1, b)
 void PutBstr(const char *key, long keylen, StrBuf *Value);
 
+#define putlbstr(a, b) PutlBstr(a, sizeof(a) - 1, b)
+void PutlBstr(const char *key, long keylen, long Value);
+
index e9955a05d51060d1291a569e91ae522a5fbd012b..02ef070c683b02bdcfebdc24d65c4d1690fb4411 100644 (file)
@@ -898,7 +898,7 @@ int GetNextParameter(StrBuf *Buf,
                        StrBufPeek(Buf, pch, -1, '\0');         
                        if (LoadTemplates > 1) {                        
                                syslog(1,
-                                       "DBG: got param [%s] %d %d\n", 
+                                       "DBG: got param [%s] "SIZE_T_FMT" "SIZE_T_FMT"\n", 
                                        pchs, pche - pchs, strlen(pchs)
                                );
                        }