X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fplot-hist.c;h=6b2e7f9f177bfe74523dc67448a39e75c882d47d;hb=05e356b2a3087e819ef3b5388e29c822f41502e1;hp=ebfcd3f107e6984a0a929053000600a6525bb2a9;hpb=a7cc8b259f0fe963aa30d4e64f7d39551ded1454;p=pspp-builds.git diff --git a/src/plot-hist.c b/src/plot-hist.c index ebfcd3f1..6b2e7f9f 100644 --- a/src/plot-hist.c +++ b/src/plot-hist.c @@ -39,6 +39,9 @@ void histogram_write_legend(struct chart *ch, const struct normal_curve *norm) { char buf[100]; + if ( !ch ) + return ; + pl_savestate_r(ch->lp); sprintf(buf,"N = %.2f",norm->N); @@ -66,6 +69,8 @@ hist_draw_bar(struct chart *ch, const gsl_histogram *hist, int bar) double lower; double height; + if ( !ch ) + return ; const size_t bins = gsl_histogram_bins(hist); const double x_pos = (ch->data_right - ch->data_left) * bar / (double) bins ; const double width = (ch->data_right - ch->data_left) / (double) bins ;