diff -Nru libmseed-2.19.7/ChangeLog libmseed-2.19.8/ChangeLog --- libmseed-2.19.7/ChangeLog 2022-03-17 05:00:47.000000000 +0000 +++ libmseed-2.19.8/ChangeLog 2022-03-29 02:46:01.000000000 +0000 @@ -1,3 +1,7 @@ +2022.087: 2.19.8 + - Update numsamples and samplecnt consistently in mst_addmsr(), #33 @pn2200 + - Fix small compiler warnings. + 2022.075: 2.19.7 - Avoid braceless multiple statements MS_SWAPBTIME macro usage. - Fix statement macros by @QuLogic. #73 diff -Nru libmseed-2.19.7/debian/changelog libmseed-2.19.8/debian/changelog --- libmseed-2.19.7/debian/changelog 2022-03-24 23:53:49.000000000 +0000 +++ libmseed-2.19.8/debian/changelog 2022-06-25 18:04:31.000000000 +0000 @@ -1,3 +1,10 @@ +libmseed (2.19.8-1) unstable; urgency=medium + + * New upstream version 2.19.8 + * d/control: bump Standards-Version to 4.6.1, no changes needed + + -- Paride Legovini Sat, 25 Jun 2022 18:04:31 +0000 + libmseed (2.19.7-1) unstable; urgency=medium * New upstream version 2.19.7 diff -Nru libmseed-2.19.7/debian/control libmseed-2.19.8/debian/control --- libmseed-2.19.7/debian/control 2021-11-09 11:11:30.000000000 +0000 +++ libmseed-2.19.8/debian/control 2022-06-25 18:04:14.000000000 +0000 @@ -8,7 +8,7 @@ Build-Depends: d-shlibs, debhelper-compat (= 13), -Standards-Version: 4.6.0 +Standards-Version: 4.6.1 Vcs-Browser: https://salsa.debian.org/science-team/libmseed Vcs-Git: https://salsa.debian.org/science-team/libmseed.git Homepage: https://ds.iris.edu/ds/nodes/dmc/software/downloads/libmseed/ diff -Nru libmseed-2.19.7/doc/ms_addselect.3 libmseed-2.19.8/doc/ms_addselect.3 --- libmseed-2.19.7/doc/ms_addselect.3 2022-03-17 05:00:47.000000000 +0000 +++ libmseed-2.19.8/doc/ms_addselect.3 2022-03-29 02:46:01.000000000 +0000 @@ -62,7 +62,7 @@ are used to create a \fIsrcname\fP. The name components may contain globbing characters for matching including wildcards and character sets, see \fBSRCNAME MATCHING\fP below. If a name component is not -specified a wildard matching all entries will be subsituted, +specified a wildard matching all entries will be substituted, i.e. \fInet\fP==NULL will be interpreted to match all network codes. As a special case a \fIloc\fP value of "--" will be translated to and empty string to match the srcname representation of a blank diff -Nru libmseed-2.19.7/doc/ms_addselect_comp.3 libmseed-2.19.8/doc/ms_addselect_comp.3 --- libmseed-2.19.7/doc/ms_addselect_comp.3 2022-03-17 05:00:47.000000000 +0000 +++ libmseed-2.19.8/doc/ms_addselect_comp.3 2022-03-29 02:46:01.000000000 +0000 @@ -62,7 +62,7 @@ are used to create a \fIsrcname\fP. The name components may contain globbing characters for matching including wildcards and character sets, see \fBSRCNAME MATCHING\fP below. If a name component is not -specified a wildard matching all entries will be subsituted, +specified a wildard matching all entries will be substituted, i.e. \fInet\fP==NULL will be interpreted to match all network codes. As a special case a \fIloc\fP value of "--" will be translated to and empty string to match the srcname representation of a blank diff -Nru libmseed-2.19.7/doc/ms_freeselections.3 libmseed-2.19.8/doc/ms_freeselections.3 --- libmseed-2.19.7/doc/ms_freeselections.3 2022-03-17 05:00:47.000000000 +0000 +++ libmseed-2.19.8/doc/ms_freeselections.3 2022-03-29 02:46:01.000000000 +0000 @@ -62,7 +62,7 @@ are used to create a \fIsrcname\fP. The name components may contain globbing characters for matching including wildcards and character sets, see \fBSRCNAME MATCHING\fP below. If a name component is not -specified a wildard matching all entries will be subsituted, +specified a wildard matching all entries will be substituted, i.e. \fInet\fP==NULL will be interpreted to match all network codes. As a special case a \fIloc\fP value of "--" will be translated to and empty string to match the srcname representation of a blank diff -Nru libmseed-2.19.7/doc/ms_matchselect.3 libmseed-2.19.8/doc/ms_matchselect.3 --- libmseed-2.19.7/doc/ms_matchselect.3 2022-03-17 05:00:47.000000000 +0000 +++ libmseed-2.19.8/doc/ms_matchselect.3 2022-03-29 02:46:01.000000000 +0000 @@ -62,7 +62,7 @@ are used to create a \fIsrcname\fP. The name components may contain globbing characters for matching including wildcards and character sets, see \fBSRCNAME MATCHING\fP below. If a name component is not -specified a wildard matching all entries will be subsituted, +specified a wildard matching all entries will be substituted, i.e. \fInet\fP==NULL will be interpreted to match all network codes. As a special case a \fIloc\fP value of "--" will be translated to and empty string to match the srcname representation of a blank diff -Nru libmseed-2.19.7/doc/ms_printselections.3 libmseed-2.19.8/doc/ms_printselections.3 --- libmseed-2.19.7/doc/ms_printselections.3 2022-03-17 05:00:47.000000000 +0000 +++ libmseed-2.19.8/doc/ms_printselections.3 2022-03-29 02:46:01.000000000 +0000 @@ -62,7 +62,7 @@ are used to create a \fIsrcname\fP. The name components may contain globbing characters for matching including wildcards and character sets, see \fBSRCNAME MATCHING\fP below. If a name component is not -specified a wildard matching all entries will be subsituted, +specified a wildard matching all entries will be substituted, i.e. \fInet\fP==NULL will be interpreted to match all network codes. As a special case a \fIloc\fP value of "--" will be translated to and empty string to match the srcname representation of a blank diff -Nru libmseed-2.19.7/doc/ms_readselectionsfile.3 libmseed-2.19.8/doc/ms_readselectionsfile.3 --- libmseed-2.19.7/doc/ms_readselectionsfile.3 2022-03-17 05:00:47.000000000 +0000 +++ libmseed-2.19.8/doc/ms_readselectionsfile.3 2022-03-29 02:46:01.000000000 +0000 @@ -62,7 +62,7 @@ are used to create a \fIsrcname\fP. The name components may contain globbing characters for matching including wildcards and character sets, see \fBSRCNAME MATCHING\fP below. If a name component is not -specified a wildard matching all entries will be subsituted, +specified a wildard matching all entries will be substituted, i.e. \fInet\fP==NULL will be interpreted to match all network codes. As a special case a \fIloc\fP value of "--" will be translated to and empty string to match the srcname representation of a blank diff -Nru libmseed-2.19.7/doc/ms_selection.3 libmseed-2.19.8/doc/ms_selection.3 --- libmseed-2.19.7/doc/ms_selection.3 2022-03-17 05:00:47.000000000 +0000 +++ libmseed-2.19.8/doc/ms_selection.3 2022-03-29 02:46:01.000000000 +0000 @@ -62,7 +62,7 @@ are used to create a \fIsrcname\fP. The name components may contain globbing characters for matching including wildcards and character sets, see \fBSRCNAME MATCHING\fP below. If a name component is not -specified a wildard matching all entries will be subsituted, +specified a wildard matching all entries will be substituted, i.e. \fInet\fP==NULL will be interpreted to match all network codes. As a special case a \fIloc\fP value of "--" will be translated to and empty string to match the srcname representation of a blank diff -Nru libmseed-2.19.7/example/msrepack.c libmseed-2.19.8/example/msrepack.c --- libmseed-2.19.7/example/msrepack.c 2022-03-17 05:00:47.000000000 +0000 +++ libmseed-2.19.8/example/msrepack.c 2022-03-29 02:46:01.000000000 +0000 @@ -8,8 +8,6 @@ * output file. * * Written by Chad Trabant, IRIS Data Management Center - * - * modified 2012.105 ***************************************************************************/ #include @@ -18,11 +16,6 @@ #include #include -#ifndef WIN32 - #include - static void term_handler (int sig); -#endif - #include #define VERSION "[libmseed " LIBMSEED_VERSION " example]" @@ -44,7 +37,10 @@ static int parameter_proc (int argcount, char **argvec); static void record_handler (char *record, int reclen, void *ptr); static void usage (void); -static void term_handler (int sig); +#ifndef WIN32 + #include + static void term_handler (int sig); +#endif int main (int argc, char **argv) @@ -141,7 +137,7 @@ /* Replace network code */ if ( netcode ) - strncpy (msr->network, netcode, sizeof(msr->network)); + strncpy (msr->network, netcode, sizeof(msr->network) - 1); /* If no samples in the record just pack the header */ if ( outfile && msr->numsamples == 0 ) diff -Nru libmseed-2.19.7/example/msview.c libmseed-2.19.8/example/msview.c --- libmseed-2.19.7/example/msview.c 2022-03-17 05:00:47.000000000 +0000 +++ libmseed-2.19.8/example/msview.c 2022-03-29 02:46:01.000000000 +0000 @@ -7,8 +7,6 @@ * details for each record. * * Written by Chad Trabant, ORFEUS/EC-Project MEREDIAN - * - * modified 2016.233 ***************************************************************************/ #include @@ -17,11 +15,6 @@ #include #include -#ifndef WIN32 -#include -static void term_handler (int sig); -#endif - #include #define VERSION "[libmseed " LIBMSEED_VERSION " example]" @@ -36,7 +29,10 @@ static int parameter_proc (int argcount, char **argvec); static void usage (void); -static void term_handler (int sig); +#ifndef WIN32 + #include + static void term_handler (int sig); +#endif int main (int argc, char **argv) @@ -238,7 +234,7 @@ #ifndef WIN32 /*************************************************************************** * term_handler: - * Signal handler routine. + * Signal handler routine. ***************************************************************************/ static void term_handler (int sig) diff -Nru libmseed-2.19.7/libmseed.h libmseed-2.19.8/libmseed.h --- libmseed-2.19.7/libmseed.h 2022-03-17 05:00:47.000000000 +0000 +++ libmseed-2.19.8/libmseed.h 2022-03-29 02:46:01.000000000 +0000 @@ -28,8 +28,8 @@ extern "C" { #endif -#define LIBMSEED_VERSION "2.19.7" -#define LIBMSEED_RELEASE "2022.075" +#define LIBMSEED_VERSION "2.19.8" +#define LIBMSEED_RELEASE "2022.087" /* C99 standard headers */ #include diff -Nru libmseed-2.19.7/msrutils.c libmseed-2.19.8/msrutils.c --- libmseed-2.19.7/msrutils.c 2022-03-17 05:00:47.000000000 +0000 +++ libmseed-2.19.8/msrutils.c 2022-03-29 02:46:01.000000000 +0000 @@ -6,8 +6,6 @@ * Written by Chad Trabant * ORFEUS/EC-Project MEREDIAN * IRIS Data Management Center - * - * modified: 2016.283 ***************************************************************************/ #include @@ -254,7 +252,7 @@ struct blkt_link_s *cur_blkt; hptime_t hptimems; int8_t usecoffset; - char seqnum[11]; + char seqnum[16]; int offset = 0; int blktcnt = 0; int reclenexp = 0; diff -Nru libmseed-2.19.7/pack.c libmseed-2.19.8/pack.c --- libmseed-2.19.7/pack.c 2022-03-17 05:00:47.000000000 +0000 +++ libmseed-2.19.8/pack.c 2022-03-29 02:46:01.000000000 +0000 @@ -6,8 +6,6 @@ * * Written by Chad Trabant, * IRIS Data Management Center - * - * modified: 2015.273 ***************************************************************************/ #include @@ -847,7 +845,7 @@ struct fsdh_s *fsdh; hptime_t hptimems; int8_t usecoffset; - char seqnum[11]; + char seqnum[16]; if (!msr || !rawrec) return -1; diff -Nru libmseed-2.19.7/traceutils.c libmseed-2.19.8/traceutils.c --- libmseed-2.19.7/traceutils.c 2022-03-17 05:00:47.000000000 +0000 +++ libmseed-2.19.8/traceutils.c 2022-03-29 02:46:01.000000000 +0000 @@ -438,7 +438,7 @@ { int samplesize = 0; - if (!mst || !msr) + if (!mst || !msr || (whence != 1 && whence != 2)) return -1; /* Reallocate data sample buffer if samples are present */ @@ -473,40 +473,34 @@ ms_log (2, "mst_addmsr(): Cannot allocate memory\n"); return -1; } - } - /* Add samples at end of trace */ - if (whence == 1) - { - if (msr->datasamples && msr->numsamples >= 0) + /* Add samples at end of trace */ + if (whence == 1) { memcpy ((char *)mst->datasamples + (mst->numsamples * samplesize), msr->datasamples, (size_t) (msr->numsamples * samplesize)); mst->numsamples += msr->numsamples; - } - mst->endtime = msr_endtime (msr); + mst->endtime = msr_endtime (msr); - if (mst->endtime == HPTERROR) - { - ms_log (2, "mst_addmsr(): Error calculating record end time\n"); - return -1; + if (mst->endtime == HPTERROR) + { + ms_log (2, "mst_addmsr(): Error calculating record end time\n"); + return -1; + } } - } - /* Add samples at the beginning of trace */ - else if (whence == 2) - { - if (msr->datasamples && msr->numsamples >= 0) + /* Add samples at the beginning of trace */ + else if (whence == 2) { /* Move any samples to end of buffer */ if (mst->numsamples > 0) { memmove ((char *)mst->datasamples + (msr->numsamples * samplesize), - mst->datasamples, - (size_t) (mst->numsamples * samplesize)); + mst->datasamples, + (size_t) (mst->numsamples * samplesize)); } memcpy (mst->datasamples, @@ -514,17 +508,17 @@ (size_t) (msr->numsamples * samplesize)); mst->numsamples += msr->numsamples; - } - mst->starttime = msr->starttime; - } + mst->starttime = msr->starttime; + } - /* If two different data qualities reset the MSTrace.dataquality to 0 */ - if (mst->dataquality && msr->dataquality && mst->dataquality != msr->dataquality) - mst->dataquality = 0; + /* If two different data qualities reset the MSTrace.dataquality to 0 */ + if (mst->dataquality && msr->dataquality && mst->dataquality != msr->dataquality) + mst->dataquality = 0; - /* Update MSTrace sample count */ - mst->samplecnt += msr->samplecnt; + /* Update MSTrace sample count */ + mst->samplecnt += msr->numsamples; + } return 0; } /* End of mst_addmsr() */ @@ -549,7 +543,7 @@ { int samplesize = 0; - if (!mst) + if (!mst || (whence != 1 && whence != 2)) return -1; if (datasamples && numsamples > 0) @@ -576,34 +570,28 @@ ms_log (2, "mst_addspan(): Cannot allocate memory\n"); return -1; } - } - /* Add samples at end of trace */ - if (whence == 1) - { - if (datasamples && numsamples > 0) + /* Add samples at end of trace */ + if (whence == 1) { memcpy ((char *)mst->datasamples + (mst->numsamples * samplesize), datasamples, (size_t) (numsamples * samplesize)); mst->numsamples += numsamples; - } - mst->endtime = endtime; - } + mst->endtime = endtime; + } - /* Add samples at the beginning of trace */ - else if (whence == 2) - { - if (datasamples && numsamples > 0) + /* Add samples at the beginning of trace */ + else if (whence == 2) { /* Move any samples to end of buffer */ if (mst->numsamples > 0) { memmove ((char *)mst->datasamples + (numsamples * samplesize), - mst->datasamples, - (size_t) (mst->numsamples * samplesize)); + mst->datasamples, + (size_t) (mst->numsamples * samplesize)); } memcpy (mst->datasamples, @@ -611,14 +599,15 @@ (size_t) (numsamples * samplesize)); mst->numsamples += numsamples; + + mst->starttime = starttime; } - mst->starttime = starttime; - } + /* Update MSTrace sample count */ + if (numsamples > 0) + mst->samplecnt += numsamples; - /* Update MSTrace sample count */ - if (numsamples > 0) - mst->samplecnt += numsamples; + } return 0; } /* End of mst_addspan() */