From ba8de5cbc7a5a1edadf371107c55f946e25421d3 Mon Sep 17 00:00:00 2001 From: Justin Pettit Date: Wed, 8 Jul 2009 14:43:29 -0700 Subject: [PATCH] Cleanup warnings about "save_ptr" in strtok_r argument The compiler warns about the "save_ptr" argument to strtok_r being unitialized. This cleans that up. --- lib/vconn-ssl.c | 3 ++- lib/vconn-tcp.c | 2 +- lib/vlog.c | 2 +- secchan/netflow.c | 2 +- 4 files changed, 5 insertions(+), 4 deletions(-) diff --git a/lib/vconn-ssl.c b/lib/vconn-ssl.c index ef1b5643..f681bdf0 100644 --- a/lib/vconn-ssl.c +++ b/lib/vconn-ssl.c @@ -280,7 +280,8 @@ ssl_vconn_cast(struct vconn *vconn) static int ssl_open(const char *name, char *suffix, struct vconn **vconnp) { - char *save_ptr, *host_name, *port_string; + char *save_ptr = NULL; + char *host_name, *port_string; struct sockaddr_in sin; int retval; int fd; diff --git a/lib/vconn-tcp.c b/lib/vconn-tcp.c index a91b7d38..11617138 100644 --- a/lib/vconn-tcp.c +++ b/lib/vconn-tcp.c @@ -72,7 +72,7 @@ new_tcp_vconn(const char *name, int fd, int connect_status, static int tcp_open(const char *name, char *suffix, struct vconn **vconnp) { - char *save_ptr; + char *save_ptr = NULL; const char *host_name; const char *port_string; struct sockaddr_in sin; diff --git a/lib/vlog.c b/lib/vlog.c index 97a930ac..1b95d96c 100644 --- a/lib/vlog.c +++ b/lib/vlog.c @@ -314,7 +314,7 @@ vlog_reopen_log_file(void) char * vlog_set_levels_from_string(const char *s_) { - char *save_ptr; + char *save_ptr = NULL; char *s = xstrdup(s_); char *module, *facility; diff --git a/secchan/netflow.c b/secchan/netflow.c index e867c0eb..0162c45a 100644 --- a/secchan/netflow.c +++ b/secchan/netflow.c @@ -107,7 +107,7 @@ static struct vlog_rate_limit rl = VLOG_RATE_LIMIT_INIT(1, 5); static int open_collector(char *dst) { - char *save_ptr; + char *save_ptr = NULL; const char *host_name; const char *port_string; struct sockaddr_in sin; -- 2.30.2