Commit 2dd65775 authored by Matteo Quintiliani's avatar Matteo Quintiliani

Declared NMXP_DATA_MAX_SIZE_DATE and set to 200


git-svn-id: file:///home/quintiliani/svncopy/nmxptool/trunk@1232 3cd66e75-5955-46cb-a940-c26e5fc5497d
parent d78a6be5
......@@ -7,7 +7,7 @@
* Istituto Nazionale di Geofisica e Vulcanologia - Italy
* quintiliani@ingv.it
*
* $Id: nmxp_data.h,v 1.30 2009-03-10 14:34:57 mtheo Exp $
* $Id: nmxp_data.h,v 1.31 2009-03-10 16:57:07 mtheo Exp $
*
*/
......@@ -98,6 +98,8 @@ typedef struct {
} NMXP_MESSAGE_HEADER;
#define NMXP_DATA_MAX_SIZE_DATE 200
/*! \brief Length in bytes of channel strings */
#define NETWORK_LENGTH 10
......
......@@ -7,7 +7,7 @@
* Istituto Nazionale di Geofisica e Vulcanologia - Italy
* quintiliani@ingv.it
*
* $Id: nmxp.c,v 1.90 2009-03-10 16:36:25 mtheo Exp $
* $Id: nmxp.c,v 1.91 2009-03-10 16:57:07 mtheo Exp $
*
*/
......@@ -533,7 +533,7 @@ NMXP_META_CHAN_LIST *nmxp_getMetaChannelList(char * hostname, int portnum, NMXP_
NMXP_CHANNELINFOREQUEST channelInfoRequestBody;
NMXP_CHANNELINFORESPONSE *channelInfo;
char str_start[200], str_end[200];
char str_start[NMXP_DATA_MAX_SIZE_DATE], str_end[NMXP_DATA_MAX_SIZE_DATE];
str_start[0] = 0;
str_end[0] = 0;
......@@ -750,7 +750,7 @@ int nmxp_raw_stream_manage(NMXP_RAW_STREAM_DATA *p, NMXP_DATA_PROCESS *a_pd, int
double latency = 0.0;
int j=0, k=0;
int i_func_pd;
char str_time[200];
char str_time[NMXP_DATA_MAX_SIZE_DATE];
NMXP_DATA_PROCESS *pd = NULL;
int y, w;
int count_null_element = 0;
......
......@@ -7,7 +7,7 @@
* Istituto Nazionale di Geofisica e Vulcanologia - Italy
* quintiliani@ingv.it
*
* $Id: nmxp_chan.c,v 1.43 2009-03-10 16:36:25 mtheo Exp $
* $Id: nmxp_chan.c,v 1.44 2009-03-10 16:57:07 mtheo Exp $
*
*/
......@@ -320,7 +320,7 @@ NMXP_CHAN_LIST_NET *nmxp_chan_subset(NMXP_CHAN_LIST *channelList, NMXP_DATATYPE
ret_channelList->channel[ret_channelList->number].key = channelList->channel[i_chan_found].key;
strncpy(ret_channelList->channel[ret_channelList->number].name, channelList->channel[i_chan_found].name, NMXP_CHAN_MAX_SIZE_NAME);
nmxp_chan_cpy_sta_chan(sta_chan_code_pattern, station_code, channel_code, network_code);
sprintf(ret_channelList->channel[ret_channelList->number].name, "%s.%s",
snprintf(ret_channelList->channel[ret_channelList->number].name, NMXP_CHAN_MAX_SIZE_NAME, "%s.%s",
(network_code[0] != 0)? network_code : network_code_default, channelList->channel[i_chan_found].name);
nmxp_log(NMXP_LOG_NORM, NMXP_LOG_D_CHANNEL, "Added %s for %s.\n",
ret_channelList->channel[ret_channelList->number].name, sta_chan_code_pattern);
......@@ -633,7 +633,7 @@ NMXP_META_CHAN_LIST *nmxp_meta_chan_set_network(NMXP_META_CHAN_LIST *chan_list,
void nmxp_meta_chan_print(NMXP_META_CHAN_LIST *chan_list) {
NMXP_META_CHAN_LIST *iter = chan_list;
char str_start_time[200], str_end_time[200];
char str_start_time[NMXP_DATA_MAX_SIZE_DATE], str_end_time[NMXP_DATA_MAX_SIZE_DATE];
int i_chan = 0;
str_start_time[0] = 0;
......@@ -662,7 +662,7 @@ void nmxp_meta_chan_print(NMXP_META_CHAN_LIST *chan_list) {
void nmxp_meta_chan_print_with_match(NMXP_META_CHAN_LIST *chan_list, char *sta_chan_list) {
NMXP_META_CHAN_LIST *iter = chan_list;
char str_start_time[200], str_end_time[200];
char str_start_time[NMXP_DATA_MAX_SIZE_DATE], str_end_time[NMXP_DATA_MAX_SIZE_DATE];
int i_chan = 0;
int ret_match = 0;
int istalist, ista;
......
......@@ -7,7 +7,7 @@
* Istituto Nazionale di Geofisica e Vulcanologia - Italy
* quintiliani@ingv.it
*
* $Id: nmxp_data.c,v 1.64 2009-03-10 15:06:06 mtheo Exp $
* $Id: nmxp_data.c,v 1.65 2009-03-10 16:57:07 mtheo Exp $
*
*/
......@@ -184,7 +184,7 @@ int nmxp_data_to_str(char *out_str, double time_d) {
}
tm_start_time = gmtime(&time_t_start_time);
sprintf(out_str, "%04d.%03d,%02d:%02d:%02d.%04d",
snprintf(out_str, NMXP_DATA_MAX_SIZE_DATE, "%04d.%03d,%02d:%02d:%02d.%04d",
tm_start_time->tm_year + 1900,
/*
tm_start_time->tm_mon + 1,
......@@ -352,7 +352,7 @@ double nmxp_data_latency(NMXP_DATA_PROCESS *pd) {
int nmxp_data_log(NMXP_DATA_PROCESS *pd, int flag_sample) {
char str_start[200], str_end[200];
char str_start[NMXP_DATA_MAX_SIZE_DATE], str_end[NMXP_DATA_MAX_SIZE_DATE];
int i;
str_start[0] = 0;
......
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