From d1fb139bbb6169e389956e3606f6ab9a58833c7e Mon Sep 17 00:00:00 2001 From: =?utf8?q?Wilfried=20G=C3=B6esgens?= Date: Sat, 13 Dec 2008 13:43:19 +0000 Subject: [PATCH] * StrBufExtract_token wouldn't reset its target buffer in all conditions. --- libcitadel/debian/files | 6 +++--- libcitadel/debian/rules | 9 +++++++-- libcitadel/lib/stringbuf.c | 12 +++++++----- 3 files changed, 17 insertions(+), 10 deletions(-) diff --git a/libcitadel/debian/files b/libcitadel/debian/files index d2ac0561c..73fc3064e 100644 --- a/libcitadel/debian/files +++ b/libcitadel/debian/files @@ -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 diff --git a/libcitadel/debian/rules b/libcitadel/debian/rules index ec0451b78..4b88c184f 100755 --- a/libcitadel/debian/rules +++ b/libcitadel/debian/rules @@ -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 diff --git a/libcitadel/lib/stringbuf.c b/libcitadel/lib/stringbuf.c index 67a50ece5..036320336 100644 --- a/libcitadel/lib/stringbuf.c +++ b/libcitadel/lib/stringbuf.c @@ -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