On 12/17/2011 02:23 PM, Francesco Chemolli wrote:
> ------------------------------------------------------------
> revno: 11938
> committer: Francesco Chemolli <[email protected]>
> branch nick: trunk
> timestamp: Sat 2011-12-17 22:23:14 +0100
> message:
>   Implemented and made public StatHist copy-constructor

> StatHist::StatHist(const StatHist &src) :
>         capacity_(src.capacity_), min_(src.min_), max_(src.max_),
>         scale_(src.scale_), val_in(src.val_in), val_out(src.val_out)
> {
>     if (src.bins!=NULL) {
>         bins = static_cast<int *>(xcalloc(src.capacity_, sizeof(int)));
>         memcpy(bins,src.bins,capacity_*sizeof(*bins));
>     }
> }

Please initialize bins if src.bins are NULL or, instead of the
if-condition, assert that src.bins are not NULL.


Thank you,

Alex.

Reply via email to