|
From: Ethan A M. <merritt@u.washington.edu> - 2008-08-01 04:44:30
|
On Thursday 31 July 2008, Shigeharu TAKENO wrote:
> shige 08/01 2008
> ----------------
>
> The gnuplot of current CVS version may make core dump by the
> following script which includes the lack data of xticlabels(),
> but gnuplot-4.2.3 may not:
>
> plot '-' using 1:2:xtic(3) w l
> 1 2 tic1
> 2 3 tic2
> 3 6
> 4 4 tic4
> 5 5 tic5
> e
Thank you for the bug report.
Rather than storing a NULL label and having to test for NULL every time
the list of labels is scanned, I think it would be better not to store a
NULL label at all.
Something like this (not tested thorougly, but seems foolproof):
--- ../../gnuplot/src/axis.c 2008-06-05 21:15:58.000000000 -0700
+++ ./axis.c 2008-07-31 21:39:09.000000000 -0700
@@ -1618,6 +1618,9 @@ add_tic_user(AXIS_INDEX axis, char *label
struct ticmark *tic, *newtic;
struct ticmark listhead;
+ if (!label)
+ return;
+
/* Mark this axis as user-generated ticmarks only, unless the */
/* mix flag indicates that both user- and auto- tics are OK. */
if (!axis_array[axis].ticdef.def.mix)
> OS: Solaris 9 (sparc)
> compiler: gcc-3.4.3
>
> The following patch seems to fix it.
>
> ----- From here -----
> --- axis.c.ORG Fri Aug 1 12:20:48 2008
> +++ axis.c Fri Aug 1 13:03:09 2008
> @@ -872,8 +872,12 @@
> if (!inrange(internal, internal_min, internal_max))
> continue;
>
> - if (mark->level < 0) /* label read from data file */
> - strncpy(label, mark->label, sizeof(label));
> + if (mark->level < 0) {/* label read from data file */
> + if (mark->label != NULL)
> + strncpy(label, mark->label, sizeof(label));
> + else
> + label[0]='\0';
> + }
> else if (axis_array[axis].is_timedata)
> gstrftime(label, 24, mark->label ? mark->label : ticfmt[axis], mark->position);
> else
> ----- To here -----
>
> +========================================================+
> Shigeharu TAKENO NIigata Institute of Technology
> kashiwazaki,Niigata 945-1195 JAPAN
> sh...@ie... TEL(&FAX): +81-257-22-8161
> +========================================================+
>
> -------------------------------------------------------------------------
> This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
> Build the coolest Linux based applications with Moblin SDK & win great prizes
> Grand prize is a trip for two to an Open Source event anywhere in the world
> http://moblin-contest.org/redirect.php?banner_id=100&url=/
> _______________________________________________
> gnuplot-beta mailing list
> gnu...@li...
> https://lists.sourceforge.net/lists/listinfo/gnuplot-beta
>
--
Ethan A Merritt
Biomolecular Structure Center
University of Washington, Seattle 98195-7742
|