fix a bug with shrink_urls() when ran on text that contains no urls
authorBart Trojanowski <bart@jukie.net>
Tue, 24 Mar 2009 00:12:05 +0000 (20:12 -0400)
committerBart Trojanowski <bart@jukie.net>
Tue, 24 Mar 2009 00:12:35 +0000 (20:12 -0400)
bti.c

diff --git a/bti.c b/bti.c
index 5f4a6cb..753870c 100644 (file)
--- a/bti.c
+++ b/bti.c
@@ -829,6 +829,8 @@ static char *shrink_urls(char *text)
                return text;
 
        rcount = find_urls(text, &ranges);
+       if (!rcount)
+               return text;
 
        for (i=0; i<rcount; i+=2) {
                int url_start = ranges[i];