To see whether a string equals another string, just use strcmp().
authorGuy Harris <guy@alum.mit.edu>
Sun, 6 Mar 2016 18:09:56 +0000 (10:09 -0800)
committerGuy Harris <guy@alum.mit.edu>
Sun, 6 Mar 2016 18:11:12 +0000 (18:11 +0000)
The goal here is to see whether out_filename is "-" or not; there's no
good reason to use strncmp() here.

Fixes Coverity CID 1316605.

Change-Id: I851eee869afed58ac091982b8d303b0eda276c2e
Reviewed-on: https://code.wireshark.org/review/14361
Reviewed-by: Guy Harris <guy@alum.mit.edu>
mergecap.c

index 5dae9a14f39dd02220aac03d799ca010f2adf3a0..7d2d696868777881fede71ca0fb297676722a21a 100644 (file)
@@ -452,7 +452,7 @@ main(int argc, char *argv[])
   }
 
   /* open the outfile */
-  if (strncmp(out_filename, "-", 2) == 0) {
+  if (strcmp(out_filename, "-") == 0) {
     /* use stdout as the outfile */
     use_stdout = TRUE;
     out_fd = 1 /*stdout*/;