return ActionNone;
}
if (tolower(c) == 'j') {
- if( index(fld_active, 'N') ) {
+ if( strchr(fld_active, 'N') ) {
strcpy(fld_active, "DR AGJMXI"); /* GeoMean and jitter */
} else {
strcpy(fld_active, "LS NABWV"); /* default */
#ifdef ENABLE_IPV6
/* gethostbyname2() is deprecated so we'll use getaddrinfo() instead. */
- bzero( &hints, sizeof hints );
+ memset( &hints, 0, sizeof hints );
hints.ai_family = af;
hints.ai_socktype = SOCK_DGRAM;
error = getaddrinfo( Hostname, NULL, &hints, &res );
}
/* Convert the first addrinfo into a hostent. */
host = &trhost;
- bzero( host, sizeof trhost );
+ memset( host, 0, sizeof trhost );
host->h_name = res->ai_canonname;
host->h_aliases = NULL;
host->h_addrtype = res->ai_family;
if (j < 0) continue;
/* 1000.0 is a temporay hack for stats usec to ms, impacted net_loss. */
- if( index( data_fields[j].format, 'f' ) ) {
+ if( strchr( data_fields[j].format, 'f' ) ) {
snprintf( buf + len, sizeof(buf), data_fields[j].format,
data_fields[j].net_xxx(at) /1000.0 );
} else {
/* Format value */
const char *format;
format = data_fields[j].format;
- if( index(format, 'f') ) {
+ if( strchr(format, 'f') ) {
format = "%.2f";
} else {
format = "%d";
strcat(name, format);
/* Output json line */
- if(index(data_fields[j].format, 'f')) {
+ if(strchr(data_fields[j].format, 'f')) {
/* 1000.0 is a temporay hack for stats usec to ms, impacted net_loss. */
printf(name,
data_fields[j].title,
}
/* 1000.0 is a temporay hack for stats usec to ms, impacted net_loss. */
- if( index( data_fields[j].format, 'f' ) ) {
+ if( strchr( data_fields[j].format, 'f' ) ) {
printf( name,
title,
data_fields[j].net_xxx(at) /1000.0,
if (j < 0) continue;
/* 1000.0 is a temporay hack for stats usec to ms, impacted net_loss. */
- if( index( data_fields[j].format, 'f' ) ) {
+ if( strchr( data_fields[j].format, 'f' ) ) {
printf( ",%.2f", data_fields[j].net_xxx(at) / 1000.0);
} else {
printf( ",%d", data_fields[j].net_xxx(at) );