From: Jim Evins Date: Sat, 14 Aug 2004 14:49:09 +0000 (+0000) Subject: 2004-08-14 Jim Evins X-Git-Tag: glabels-2_3_0~451 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=a5659c418bcd65d7435c3ce51613801a64d0ac1a;p=glabels 2004-08-14 Jim Evins Fixes for Bug #1008181. * src/bc.c: (gl_barcode_default_digits): Make a format of zero digits, harmless. * src/xml-label.c: (xml_parse_object_barcode): Set default value of the format property of barcode objects to 10, not zero. This will prevent crashes when reading pre 2.0.x files. git-svn-id: https://glabels.svn.sourceforge.net/svnroot/glabels/trunk@448 f5e0f49d-192f-0410-a22d-a8d8700d0965 --- diff --git a/glabels2/ChangeLog b/glabels2/ChangeLog index 760c3438..4746303b 100644 --- a/glabels2/ChangeLog +++ b/glabels2/ChangeLog @@ -1,3 +1,13 @@ +2004-08-14 Jim Evins + + Fixes for Bug #1008181. + + * src/bc.c: (gl_barcode_default_digits): + Make a format of zero digits, harmless. + * src/xml-label.c: (xml_parse_object_barcode): + Set default value of the format property of barcode objects to 10, not + zero. This will prevent crashes when reading pre 2.0.x files. + 2004-08-09 Jim Evins * NEWS: diff --git a/glabels2/src/bc.c b/glabels2/src/bc.c index 0f8ebc87..df561c82 100644 --- a/glabels2/src/bc.c +++ b/glabels2/src/bc.c @@ -294,7 +294,7 @@ gl_barcode_default_digits (const gchar *id, if (backends[i].can_freeform) { - return g_strnfill (n, '0'); + return g_strnfill (MAX (n,1), '0'); } else { diff --git a/glabels2/src/xml-label.c b/glabels2/src/xml-label.c index 6bbfc9c7..5f51e91e 100644 --- a/glabels2/src/xml-label.c +++ b/glabels2/src/xml-label.c @@ -709,7 +709,7 @@ xml_parse_object_barcode (xmlNodePtr node, text_flag = gl_xml_get_prop_boolean (node, "text", FALSE); checksum_flag = gl_xml_get_prop_boolean (node, "checksum", TRUE); color = gl_xml_get_prop_uint (node, "color", 0); - format_digits = gl_xml_get_prop_uint (node, "format", 0); + format_digits = gl_xml_get_prop_uint (node, "format", 10); gl_label_barcode_set_props (GL_LABEL_BARCODE(object), id, text_flag, checksum_flag, format_digits); gl_label_object_set_line_color (GL_LABEL_OBJECT(object), color);