Cleanup warnings about "save_ptr" in strtok_r argument
authorJustin Pettit <jpettit@nicira.com>
Wed, 8 Jul 2009 21:43:29 +0000 (14:43 -0700)
committerJustin Pettit <jpettit@nicira.com>
Wed, 29 Jul 2009 22:18:20 +0000 (15:18 -0700)
The compiler warns about the "save_ptr" argument to strtok_r being
unitialized.  This cleans that up.

lib/vconn-ssl.c
lib/vconn-tcp.c
lib/vlog.c
secchan/netflow.c

index ef1b564..f681bdf 100644 (file)
@@ -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;
index a91b7d3..1161713 100644 (file)
@@ -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;
index 97a930a..1b95d96 100644 (file)
@@ -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;
 
index e867c0e..0162c45 100644 (file)
@@ -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;