From: Simson Garfinkel <simsong@acm.org>
Date: Sun, 2 Feb 2014 16:18:45 -0500
Subject: fixed so that it properly gets default device if no -i is given
Forwarded: yes. merged upstream at https://github.com/simsong/tcpflow/commit/9abeb43451fff5543efdac769d1efea52d4dd084

---
 src/tcpflow.cpp | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/src/tcpflow.cpp b/src/tcpflow.cpp
index 96bd38e..f5bd746 100644
--- a/src/tcpflow.cpp
+++ b/src/tcpflow.cpp
@@ -25,9 +25,6 @@
 #include <sys/types.h>
 #include <dirent.h>
 
-
-
-
 /* bring in inet_ntop if it is not present */
 #define ETH_ALEN 6
 #ifndef HAVE_INET_NTOP
@@ -388,7 +385,7 @@ int main(int argc, char *argv[])
 #endif
 
     bool force_binary_output = false;
-    const char *device = "<default>";
+    const char *device = 0;             // default device
     const char *lockname = 0;
     int need_usage = 0;
     std::string reportfilename;
@@ -649,7 +646,10 @@ int main(int argc, char *argv[])
     be13::plugin::get_scanner_feature_file_names(feature_file_names);
     feature_recorder_set fs(0);
 
-    fs.init(feature_file_names,input_fname.size()>0 ? input_fname : device,demux.outdir);
+    const char *name = device;
+    if(input_fname.size()>0) name=input_fname.c_str();
+    if(name==0) name="<default>";
+    fs.init(feature_file_names,name,demux.outdir);
     the_fs   = &fs;
     demux.fs = &fs;
 
