qt/poppler-document.cc |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 21a58562cc1e575ec3d81b6e34bfcb21306eb67f
Author: Albert Astals Cid <[EMAIL PROTECTED]>
Date:   Fri Nov 23 23:12:06 2007 +0100

    sscanf does not like null strings, so don't call it on empty qstrings

diff --git a/qt/poppler-document.cc b/qt/poppler-document.cc
index 965d5a9..597cc0f 100644
--- a/qt/poppler-document.cc
+++ b/qt/poppler-document.cc
@@ -225,7 +225,7 @@ QDateTime Document::getDate( const QString & type ) const
       s = s.mid(2);
 
     /* FIXME process time zone on systems that support it */  
-    if ( sscanf( s.latin1(), "%4d%2d%2d%2d%2d%2d", &year, &mon, &day, &hour, 
&min, &sec ) == 6 )
+    if ( !s.isEmpty() && sscanf( s.latin1(), "%4d%2d%2d%2d%2d%2d", &year, 
&mon, &day, &hour, &min, &sec ) == 6 )
     {
       /* Workaround for y2k bug in Distiller 3 stolen from gpdf, hoping that 
it won't
        *   * be used after y2.2k */
_______________________________________________
poppler mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/poppler

Reply via email to