When last two lines of input.dat are:
%******* 18.) OUTPUT STAKES **************************************
3 %1=stake locations given in local coordinates (x,y), 2=as 1 but center, 3=row/col coordinatesyes
102 125
degree.o exits with
segmentation fault 11.
We find with gbd that:
Program received signal EXC_BAD_ACCESS, Could not access memory.
Reason: KERN_INVALID_ADDRESS at address: 0x018b1c70
0x00012028 in startoutascii () at initial.c:990
990 fprintf(outgrid[i],"%s elevation = %5.0f m slope = %5.1f aspect = %5.1f",
(gdb) p stnrow[i]
$1 = 537687
(gdb) p stncol[i]
$2 = 6473500
(gdb) p griddgm[stnrow[i]][stncol[i]]
Cannot access memory at address 0x18b1c70
Looks like strnrow and strncol are being assigned incorrect values somewhere.
Compare:
input.dat:
%******* 18.) OUTPUT STAKES **************************************
1 %1=stake locations given in local coordinates (x,y), 2=as 1 but center, 3=row/col coordinatesyes
537687 6473500
Breakpoint 1, startoutascii () at initial.c:990
990 fprintf(outgrid[i],"%s elevation = %5.0f m slope = %5.1f aspect = %5.1f",
(gdb) p stncol[i]
$1 = 101
(gdb) p stnrow[i]
$2 = 80
When last two lines of input.dat are:
degree.o exits with
segmentation fault 11.
We find with gbd that:
Looks like strnrow and strncol are being assigned incorrect values somewhere.
Compare:
input.dat: