* StrBufExtract_token wouldn't reset its target buffer in all conditions.
authorWilfried Göesgens <willi@citadel.org>
Sat, 13 Dec 2008 13:43:19 +0000 (13:43 +0000)
committerWilfried Göesgens <willi@citadel.org>
Sat, 13 Dec 2008 13:43:19 +0000 (13:43 +0000)
libcitadel/debian/files
libcitadel/debian/rules
libcitadel/lib/stringbuf.c

index d2ac0561c0b0a03d7eab551e7db9c29484f59207..73fc3064e0412a561172b5a5c47e4c6ec0596e3b 100644 (file)
@@ -1,3 +1,3 @@
-libcitadel1_7.38-8_i386.deb libs optional
-libcitadel1-dbg_7.38-8_i386.deb libdevel optional
-libcitadel-dev_7.38-8_i386.deb libdevel optional
+libcitadel1_7.38-8_amd64.deb libs optional
+libcitadel1-dbg_7.38-8_amd64.deb libdevel optional
+libcitadel-dev_7.38-8_amd64.deb libdevel optional
index ec0451b78172cc3c7f6cab3dd0584db67e216989..4b88c184f1287fe2049b79bf77768660ae18e51c 100755 (executable)
@@ -10,19 +10,24 @@ DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
 DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
 
 CFLAGS = -Wall -g
-
+LDFALGS = 
 ifneq (,$(findstring debug,$(DEB_BUILD_OPTIONS)))
        CFLAGS += -O0 -ggdb -rdynamic -MD -MP -D DEBUG -D VALGRIND
 else
        CFLAGS += -O2
 endif
 
+ifneq (,$(findstring profiling,$(DEB_BUILD_OPTIONS)))
+       CFLAGS += -pg
+       LDFLAGS += -pg
+endif
+
 build: build-stamp
 build-stamp:
        dh_testdir
 
 # ./configure
-       CFLAGS="$(CFLAGS)" ./configure --host=$(DEB_HOST_GNU_TYPE) --build=$(DEB_BUILD_GNU_TYPE) \
+       CFLAGS="$(CFLAGS)"; LDFLAGS="$(LDFLAGS)";  ./configure --host=$(DEB_HOST_GNU_TYPE) --build=$(DEB_BUILD_GNU_TYPE) \
                --prefix=/usr
 
 # Build libcitadel
index 67a50ece57b97c64f1de39dcb550eedc57d5b4ca..03632033602ac168d5885644b067159671735ca2 100644 (file)
@@ -807,20 +807,22 @@ int StrBufExtract_token(StrBuf *dest, const StrBuf *Source, int parmnum, char se
        const char *s, *e;              //* source * /
        int len = 0;                    //* running total length of extracted string * /
        int current_token = 0;          //* token currently being processed * /
+        
+       if (dest != NULL) {
+               dest->buf[0] = '\0';
+               dest->BufUsed = 0;
+       }
+       else
+               return(-1);
 
        if ((Source == NULL) || (Source->BufUsed ==0)) {
                return(-1);
        }
        s = Source->buf;
        e = s + Source->BufUsed;
-       if (dest == NULL) {
-               return(-1);
-       }
 
        //cit_backtrace();
        //lprintf (CTDL_DEBUG, "test >: n: %d sep: %c source: %s \n willi \n", parmnum, separator, source);
-       dest->buf[0] = '\0';
-       dest->BufUsed = 0;
 
        while ((s<e) && !IsEmptyStr(s)) {
                if (*s == separator) {