ovs-ofctl: Use strchr() instead of strstr().
authorBen Pfaff <blp@nicira.com>
Thu, 21 Jul 2011 18:12:45 +0000 (11:12 -0700)
committerBen Pfaff <blp@nicira.com>
Thu, 21 Jul 2011 18:12:45 +0000 (11:12 -0700)
It's the right tool for the job.  Potentially faster, too.

utilities/ovs-ofctl.c

index a94bde8..7cdf42d 100644 (file)
@@ -233,7 +233,7 @@ open_vconn__(const char *name, const char *default_suffix,
     free(datapath_name);
     free(datapath_type);
 
-    if (strstr(name, ":")) {
+    if (strchr(name, ':')) {
         run(vconn_open_block(name, OFP_VERSION, vconnp),
             "connecting to %s", name);
     } else if (!stat(name, &s) && S_ISSOCK(s.st_mode)) {