fixed off-by-one bug in link handling
authorkramm <kramm>
Sat, 23 Jul 2005 15:38:54 +0000 (15:38 +0000)
committerkramm <kramm>
Sat, 23 Jul 2005 15:38:54 +0000 (15:38 +0000)
pdf2swf/swfoutput.cc

index 0d0246b..632a9ff 100644 (file)
@@ -1332,7 +1332,8 @@ void swf_drawlink(gfxdevice_t*dev, gfxline_t*points, char*url)
            if(url[t]<'0' || url[t]>'9')
                nodigit = 1;
        if(!nodigit) {
-           int page = atoi(&url[4]);
+           int page = atoi(&url[4]) - 1;
+           if(page<0) page = 0;
            swfoutput_linktopage(dev, page, points);
        }
     } else {