[GRASS5] r.in.bin error

Bob Covill bcovill at tekmap.ns.ca
Wed Dec 15 13:17:38 EST 2004


Markus,

I have discovered a bug in the latest r.in.bin related to the new 3D 
region. Presumably the bug will show up in any program that does not 
first initialize the region. The r.in.bin the error is being produced 
from either G_adjust_Cell_head or G_set_window.

To correct the error I simply added the following to main.c ...

         if (endianTest.testByte[0] == 1) {
                 swapFlag = 1; /*true: little endian */
                 if (swap == 1) swapFlag = 0; /* Swapping enabled */
         } else {
                 swapFlag = 0;
                 if (swap == 1) swapFlag = 1; /* Swapping enabled */
         }

  +       /* Get cuurent window */
  +       G_get_window(&cellhd);

If you think this is the best way to fix the problem I can go ahead and 
commit to CVS.

Basicly any program that tries to write or align a window without first 
initializing it (get_window) runs the risk of the same error.

-- 
Bob




More information about the grass-dev mailing list