gst/subparse/samiparse.c: Don't ignore return value of strtol (++compiler_happiness).
authorTim-Philipp Müller <tim@centricular.net>
Thu, 18 May 2006 10:05:23 +0000 (10:05 +0000)
committerTim-Philipp Müller <tim@centricular.net>
Thu, 18 May 2006 10:05:23 +0000 (10:05 +0000)
Original commit message from CVS:
* gst/subparse/samiparse.c: (handle_start_font):
Don't ignore return value of strtol (++compiler_happiness).

ChangeLog
gst/subparse/samiparse.c

index 7d25515..293371a 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2006-05-18  Tim-Philipp Müller  <tim at centricular dot net>
+
+       * gst/subparse/samiparse.c: (handle_start_font):
+         Don't ignore return value of strtol (++compiler_happiness).
+
 2006-05-17  Tim-Philipp Müller  <tim at centricular dot net>
 
        Patch by: Young-Ho Cha  <ganadist chollian net>
index b3906c0..dede935 100644 (file)
@@ -168,8 +168,9 @@ handle_start_font (GstSamiContext * sctx, const xmlChar ** atts)
         if (!(*value == '#' && len == 7)) {
           gchar *r;
 
-          strtol ((const char *) value, &r, 16);        /* trying onvert hex */
-          if (((xmlChar *) r == (value + 6) && len == 6)) {
+          /* check if it looks like hex */
+          if (strtol ((const char *) value, &r, 16) >= 0 &&
+              ((xmlChar *) r == (value + 6) && len == 6)) {
             sharp = "#";
           }
         }