Chad,
You are correct. Thanks.
Cheers,
Brian
Chad wrote:
You are correct. Thanks.
Cheers,
Brian
Chad wrote:
Hi Brian,
I was throwing together a quick SAC to Mini-SEED converter and looked at
your recent patch for detecting byte order from the SAC header (thanks).
I think I see an error (see below), feel free to tell me I'm wrong.
cheers,
Chad
Index: src/dff/wrsac.c...
===================================================================
RCS file: /export/home/cvs/repository/SAC/src/dff/wrsac.c,v
+ hdrVer = (long *) (header + versionLocation * 4);Testing (hdrVer < 1) here but probably want (*hdrVer < 1), heck this
+ if(hdrVer < 1 || *hdrVer > cmhdr.nvhdrc) {
test is probably always true, the pointer should always be more than 1 :)
+ byteswap( (void *) hdrVer, 4);The first test should be like this one, no?
+ if(*hdrVer < 1 || *hdrVer > cmhdr.nvhdrc) {
+ *nerr = 1317;
+ setmsg("ERROR", *nerr);
+ /* apcmsg2(&kmdfm.kdflrq[ic1 - 1], ic2-ic1+1); */
+ aplmsg("not is sac format, nor byteswapped sac format.", 62);
+ free(header);
+ goto L_8888;
+ } else {
+ free(header);
+ lswap = TRUE;
+ }
+ }