Skip to content

Commit

Permalink
No blockette 1000 in last record now working.
Browse files Browse the repository at this point in the history
  • Loading branch information
krischer committed Oct 3, 2016
1 parent 29f2007 commit fe8e803
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion obspy/io/mseed/src/libmseed/parseutils.c
Original file line number Diff line number Diff line change
Expand Up @@ -319,8 +319,18 @@ ms_detect ( const char *record, int recbuflen )
}
}

if ( ! foundlen )
if ( ! foundlen ) {
if ( recbuflen == 128 ||
recbuflen == 256 ||
recbuflen == 512 ||
recbuflen == 1024 ||
recbuflen == 2048 ||
recbuflen == 4096 ||
recbuflen == 8192 ||
recbuflen == 16348)
return recbuflen;
return 0;
}
else
return reclen;
} /* End of ms_detect() */
Expand Down

1 comment on commit fe8e803

@chad-earthscope
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ms_detect() determines if a record is detected and, if possible, what the record length is. With these changes the routine assumes too much.

It is the caller of this routine that knows the context of the buffer. Knowing that there is no more data, therefore implying a record length, is a job for the caller. This is easily done when the return from ms_detect() is 0.

Please sign in to comment.