From Harald Welte:
[obnox/wireshark/wip.git] / trigcap.c
index 370bf77564eec2fbbc5a56973acb872662560233..394c50ad211f8aa4c415a118442c68f8098f3296 100644 (file)
--- a/trigcap.c
+++ b/trigcap.c
@@ -49,12 +49,12 @@ static void panic(int err, const char* fmt, ...) {
 static void dprintf(int lev, const char* fmt, ...) {
        va_list ap;
 
-       va_start(ap,fmt);
        if (lev <= debug_level) {
+               va_start(ap,fmt);
                vfprintf(stderr,fmt,ap);
+               va_end(ap);
                fflush(stderr);
        }
-       va_end(ap);
 }
 
 
@@ -68,7 +68,7 @@ static void usage(int err) {
        "   -p promiscuous mode\n"
        "   -s snapshot length\n"
        "   -q quiet\n"
-       "   -d increase deug level\n"
+       "   -d increase debug level\n"
        "   -h prints this message\n"
        ;
 
@@ -172,7 +172,7 @@ int main(int argc, char** argv) {
 
        dprintf(1,"starting with:\n interface: %s\n snaplen: %d\n promisc: %d"
                        "\n outfile: %s\n capture filter: %s\n start: %s\n stop: %s\n debug level: %d\n",
-                       interface ? interface : "to be choosen",
+                       interface ? interface : "to be chosen",
                        snaplen,
                        promisc,
                        outfile ? outfile : "** missing **",