r.digit, r.in.poly, r.mask bug report for grass5.0beta

Justin Hickey jhickey at impact1.hpcc.nectec.or.th
Tue Mar 2 07:41:05 EST 1999


Hello Jaro

On Feb 25,  1:16pm, Jaro Hofierka wrote:
> Subject: r.digit, r.in.poly, r.mask bug report for grass5.0beta
> In r.mask, there is another error:
>
> > ERROR: G_calloc: out of memory
>

For this bug you may want to look at the file

$GIS/src/raster/r.reclass/inter/maketable.c

This file is used by r.mask and around line 28 you should find the line

char_table = (char **) G_calloc((max-min+1) * sizeof(char *));

The arguments to this function are wrong. G_calloc is supposed to take the
number of elements as its first argument followed by the element size for its
second argument. The above line only contains one argument.

To fix this, either change the arguments to the G_calloc call or change the
call to G_malloc which takes the single argument provided to the above G_calloc
call.

I orginally posted this when I found it and someone fixed the code for Grass
4.2 at the time, but apparently, Baylor developers missed it since it is still
in the Grass 5.0beta code. Which means I have to change my own version as well
:)

Hope this helps.

-- 
Sincerely,

Jazzman (a.k.a. Justin Hickey)  e-mail: jhickey at hpcc.nectec.or.th
High Performance Computing Center
National Electronics and Computer Technology Center (NECTEC)
Bangkok, Thailand
==================================================================
People who think they know everything are very irritating to those
of us who do.  ---Anonymous

Jazz and Trek Rule!!!
==================================================================



More information about the grass-user mailing list