projects
/
pspp
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
lex_get_text_buffer_read: Avoid potential buffer overflow.
[pspp]
/
src
/
math
/
histogram.c
diff --git
a/src/math/histogram.c
b/src/math/histogram.c
index 3c88c3858f61c6b1c2230843a7b9151a47902956..1b55d204b866fa2e15dc4ff3f84d3b3a509a9915 100644
(file)
--- a/
src/math/histogram.c
+++ b/
src/math/histogram.c
@@
-1,5
+1,5
@@
/* PSPP - a program for statistical analysis.
/* PSPP - a program for statistical analysis.
- Copyright (C) 2004, 2008, 2009 Free Software Foundation, Inc.
+ Copyright (C) 2004, 2008, 2009
, 2011
Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@
-15,16
+15,17
@@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include <config.h>
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include <config.h>
-#include "histogram.h"
-#include <gl/xalloc.h>
-#include <libpspp/assertion.h>
-#include <libpspp/cast.h>
+#include "math/histogram.h"
#include <gsl/gsl_histogram.h>
#include <gsl/gsl_histogram.h>
-#include "chart-geometry.h"
#include <math.h>
#include <math.h>
+#include "libpspp/assertion.h"
+#include "libpspp/cast.h"
+#include "math/chart-geometry.h"
+
+#include "gl/xalloc.h"
void
histogram_add (struct histogram *h, double y, double c)
void
histogram_add (struct histogram *h, double y, double c)
@@
-65,7
+66,7
@@
histogram_create (int bins, double min, double max)
int n = ceil (max / (bin_width_2) ) ;
int n = ceil (max / (bin_width_2) ) ;
- assert (max > min);
+ assert (max >
=
min);
if ( ! (n % 2 ) ) n++;
upper_limit = n * bin_width_2;
if ( ! (n % 2 ) ) n++;
upper_limit = n * bin_width_2;