From 25afb555d0b6f5e257a3706e38b3da827b88bbda Mon Sep 17 00:00:00 2001 From: William Joye Date: Wed, 19 Sep 2018 13:42:51 -0400 Subject: WCS: fix a memory ref with short axes symbols (aka 'b') --- tksao/frame/fitsimage.C | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/tksao/frame/fitsimage.C b/tksao/frame/fitsimage.C index 1b653b8..3daaa5d 100644 --- a/tksao/frame/fitsimage.C +++ b/tksao/frame/fitsimage.C @@ -3073,19 +3073,20 @@ void FitsImage::scanWCS(FitsHead* hd) ostringstream str; str << "Symbol(" << jj+1 << ")" << ends; const char* ss = astGetC(ff, str.str().c_str()); + size_t lss = strlen(ss); // cerr << "Symbol: " << ss << endl; if (ss) { if (!strcmp(ss,"RA") || !strcmp(ss,"l") || !strcmp(ss,"Lambda") || - !strcmp(ss+1,"LON") || - !strcmp(ss+2,"LN")) + (lss>1 && !strcmp(ss+1,"LON")) || + (lss>2 && !strcmp(ss+2,"LN"))) wcsCelLon_[ii] = jj+1; else if (!strcmp(ss,"Dec") || !strcmp(ss,"b") || !strcmp(ss,"Beta") || - !strcmp(ss+1,"LAT") || - !strcmp(ss+2,"LT")) + (lss>1 && !strcmp(ss+1,"LAT")) || + (lss>2 && !strcmp(ss+2,"LT"))) wcsCelLat_[ii] = jj+1; } } -- cgit v0.12