[GRASS-dev] Re: [GRASS-SVN] r40554 - grass/trunk/raster/r.in.bin

On Tue, Jan 19, 2010 at 4:41 PM, <svn_grass@osgeo.org> wrote:

Author: glynn
Date: 2010-01-19 10:41:38 -0500 (Tue, 19 Jan 2010)
New Revision: 40554

Modified:
grass/trunk/raster/r.in.bin/main.c
Log:
Fix segfault with -d and anull=...

Modified: grass/trunk/raster/r.in.bin/main.c

--- grass/trunk/raster/r.in.bin/main.c 2010-01-19 11:46:59 UTC (rev 40553)
+++ grass/trunk/raster/r.in.bin/main.c 2010-01-19 15:41:38 UTC (rev 40554)
@@ -555,7 +555,11 @@
cell[col] = (CELL) (unsigned int)x_i[col];
}
if (parm.anull->answer) {
- if (flag.f->answer) {
+ if (flag.d->answer) {
+ if (dcell[col] == nul_val)
+ Rast_set_d_null_value(&dcell[col], 1);
+ }
+ else if (flag.f->answer) {
if (fcell[col] == (float)nul_val)
Rast_set_f_null_value(&fcell[col], 1);
}

Should this be backported with G_set_[f|d]_null_value()?

Markus

Markus Neteler wrote:

> Author: glynn
> Date: 2010-01-19 10:41:38 -0500 (Tue, 19 Jan 2010)
> New Revision: 40554
>
> Modified:
> grass/trunk/raster/r.in.bin/main.c
> Log:
> Fix segfault with -d and anull=...

Should this be backported with G_set_[f|d]_null_value()?

Yes; the 'c' and 'f' cases are already there; this adds the 'd' case.

--
Glynn Clements <glynn@gclements.plus.com>

On Wed, Jan 20, 2010 at 7:33 AM, Glynn Clements
<glynn@gclements.plus.com> wrote:

Markus Neteler wrote:

> Author: glynn
> Date: 2010-01-19 10:41:38 -0500 (Tue, 19 Jan 2010)
> New Revision: 40554
>
> Modified:
> grass/trunk/raster/r.in.bin/main.c
> Log:
> Fix segfault with -d and anull=...

Should this be backported with G_set_[f|d]_null_value()?

Yes; the 'c' and 'f' cases are already there; this adds the 'd' case.

Done.

Markus