From: Adam Dickmeiss Date: Thu, 20 Dec 2012 10:59:55 +0000 (+0100) Subject: odr_prepend: zero length prefix ignored X-Git-Tag: v4.2.48~10 X-Git-Url: http://sru.miketaylor.org.uk/?a=commitdiff_plain;h=82fade1c1b7531cda93c908e33d9af8b9fd91a6f;p=yaz-moved-to-github.git odr_prepend: zero length prefix ignored --- diff --git a/src/odr_util.c b/src/odr_util.c index 17d1582..58b60cb 100644 --- a/src/odr_util.c +++ b/src/odr_util.c @@ -107,9 +107,9 @@ char *odr_prepend(ODR o, const char *prefix, const char *old) char *res = (char*) odr_malloc (o, olen + plen + 2); *res = '\0'; - if (prefix != 0) + if (plen > 0) strcpy (res, prefix); - if (prefix != 0 && old != 0) + if (plen > 0 && old != 0) strcat (res, "/"); if (old !=0) strcat (res, old);