From 82fade1c1b7531cda93c908e33d9af8b9fd91a6f Mon Sep 17 00:00:00 2001 From: Adam Dickmeiss Date: Thu, 20 Dec 2012 11:59:55 +0100 Subject: [PATCH] odr_prepend: zero length prefix ignored --- src/odr_util.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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); -- 1.7.10.4