diff --git a/src/lib/Radio/readsky.c b/src/lib/Radio/readsky.c index f30553b..b340d41 100644 --- a/src/lib/Radio/readsky.c +++ b/src/lib/Radio/readsky.c @@ -686,8 +686,10 @@ printf("Nc=%d\n",Nc); memset(buf,0,buff_len); c=read_next_string(&buf,&buff_len,cfp); if (c!=1) { - /* first column is solution number (int) 1..8N */ + /* first column is solution number (int) 0..8N-1 */ sscanf(buf,"%d",&cn); + /* also do a sanity check */ + if ( cn<0 || cn>Nc ) cn=0; } #ifdef DEBUG printf("%d ",cn);