Changed all the licence notices in all the files.
[pspp] / src / plot-hist.c
index ebfcd3f107e6984a0a929053000600a6525bb2a9..ad86769325a3fbfbf63a5dc87c847a1bbe966d3e 100644 (file)
@@ -14,8 +14,8 @@
 
    You should have received a copy of the GNU General Public License
    along with this program; if not, write to the Free Software
-   Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
-   02111-1307, USA. */
+   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+   02110-1301, USA. */
 
 /* If you add/modify any public symbols in this file, don't forget to
    change the stubs in dummy-chart.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 ;