Commit 18299f09 authored by Matteo Quintiliani's avatar Matteo Quintiliani

Added checks for pd=NULL


git-svn-id: file:///home/quintiliani/svncopy/nmxptool/trunk@414 3cd66e75-5955-46cb-a940-c26e5fc5497d
parent b4774d75
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
* Istituto Nazionale di Geofisica e Vulcanologia - Italy * Istituto Nazionale di Geofisica e Vulcanologia - Italy
* quintiliani@ingv.it * quintiliani@ingv.it
* *
* $Id: nmxptool.c,v 1.80 2007-10-04 20:06:39 mtheo Exp $ * $Id: nmxptool.c,v 1.81 2007-10-04 20:36:06 mtheo Exp $
* *
*/ */
...@@ -565,14 +565,17 @@ int main (int argc, char **argv) { ...@@ -565,14 +565,17 @@ int main (int argc, char **argv) {
nmxp_data_log(pd); nmxp_data_log(pd);
} }
if(pd) {
/* Set cur_chan */ /* Set cur_chan */
cur_chan = nmxp_chan_lookupKeyIndex(pd->key, channelList_subset); cur_chan = nmxp_chan_lookupKeyIndex(pd->key, channelList_subset);
}
/* Manage Raw Stream */ /* Manage Raw Stream */
if(params.stc == -1) { if(params.stc == -1) {
nmxp_raw_stream_manage(&(channelListSeq[cur_chan].raw_stream_buffer), pd, p_func_pd, n_func_pd); nmxp_raw_stream_manage(&(channelListSeq[cur_chan].raw_stream_buffer), pd, p_func_pd, n_func_pd);
} else { } else {
if(pd) {
/* Management of gaps */ /* Management of gaps */
if(!channelListSeq[cur_chan].significant && pd->nSamp > 0) { if(!channelListSeq[cur_chan].significant && pd->nSamp > 0) {
channelListSeq[cur_chan].significant = 1; channelListSeq[cur_chan].significant = 1;
...@@ -604,7 +607,9 @@ int main (int argc, char **argv) { ...@@ -604,7 +607,9 @@ int main (int argc, char **argv) {
} }
#endif #endif
} }
}
if(pd) {
/* Store x_1 */ /* Store x_1 */
if(pd->nSamp > 0) { if(pd->nSamp > 0) {
channelListSeq[cur_chan].x_1 = pd->pDataPtr[pd->nSamp-1]; channelListSeq[cur_chan].x_1 = pd->pDataPtr[pd->nSamp-1];
...@@ -614,6 +619,7 @@ int main (int argc, char **argv) { ...@@ -614,6 +619,7 @@ int main (int argc, char **argv) {
free(pd->buffer); free(pd->buffer);
pd->buffer = NULL; pd->buffer = NULL;
} }
}
// TODO // TODO
exitpdscondition = 1; exitpdscondition = 1;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment