applied getinfo_crash.patch and info_only.patch by Ricardo Pedroso
authorMatthias Kramm <kramm@quiss.org>
Tue, 25 Aug 2009 16:09:09 +0000 (18:09 +0200)
committerMatthias Kramm <kramm@quiss.org>
Tue, 25 Aug 2009 16:09:09 +0000 (18:09 +0200)
lib/pdf/pdf.cc
src/pdf2swf.c

index 5cada51..1a6969d 100644 (file)
@@ -390,7 +390,7 @@ char* pdf_doc_getinfo(gfxdocument_t*doc, const char*name)
         sprintf(buf, "%.1f", i->doc->getPDFVersion());
         return strdup(buf);
     }
-    return 0;
+    return strdup("");
 }
 
 
index 4255fbf..f2425c7 100644 (file)
@@ -640,18 +640,20 @@ int main(int argn, char *argv[])
        exit(1);
     }
 
-    if(!outputname)
-    {
-       if(filename) {
-           outputname = stripFilename(filename, ".swf");
-           msg("<notice> Output filename not given. Writing to %s", outputname);
-       } 
-    }
-       
-    if(!outputname)
-    {
-       fprintf(stderr, "Please use -o to specify an output file\n");
-       exit(1);
+    if (!info_only) {
+        if(!outputname)
+        {
+            if(filename) {
+                outputname = stripFilename(filename, ".swf");
+                msg("<notice> Output filename not given. Writing to %s", outputname);
+            } 
+        }
+            
+        if(!outputname)
+        {
+            fprintf(stderr, "Please use -o to specify an output file\n");
+            exit(1);
+        }
     }
 
     // test if the page range is o.k.