Convert "4 space tabs" to spaces; Minor reformatting.
[obnox/wireshark/wip.git] / rawshark.c
index df30037b8995ac76c1183e7b47a3516d9fd0f0d6..e900257d139bfc183c15641839948087bbc7db40 100644 (file)
@@ -61,9 +61,7 @@
 # include <sys/stat.h>
 #endif
 
-#ifdef HAVE_GETOPT_H
-#include <getopt.h>
-#else
+#ifndef HAVE_GETOPT
 #include "wsutil/wsgetopt.h"
 #endif
 
@@ -209,14 +207,16 @@ print_usage(gboolean print_ver)
     fprintf(output, "  -F <field>               field to display\n");
     fprintf(output, "  -n                       disable all name resolution (def: all enabled)\n");
     fprintf(output, "  -N <name resolve flags>  enable specific name resolution(s): \"mntC\"\n");
-    fprintf(output, "  -p                       use the system's packet header format (which may have 64-bit timestamps)\n");
+    fprintf(output, "  -p                       use the system's packet header format\n");
+    fprintf(output, "                           (which may have 64-bit timestamps)\n");
     fprintf(output, "  -R <read filter>         packet filter in Wireshark display filter syntax\n");
     fprintf(output, "  -s                       skip PCAP header on input\n");
 
-    /*fprintf(output, "\n");*/
+    fprintf(output, "\n");
     fprintf(output, "Output:\n");
     fprintf(output, "  -l                       flush output after each packet\n");
-    fprintf(output, "  -S                       format string for fields (%%D - name, %%S - stringval, %%N numval)\n");
+    fprintf(output, "  -S                       format string for fields\n");
+    fprintf(output, "                           (%%D - name, %%S - stringval, %%N numval)\n");
     fprintf(output, "  -t ad|a|r|d|dd|e         output format of time stamps (def: r: rel. to first)\n");
 
     fprintf(output, "\n");
@@ -939,7 +939,7 @@ raw_pipe_read(struct wtap_pkthdr *phdr, guchar * pd, int *err, const gchar **err
     printf("len: %d (%04x)\n", hdr.len, hdr.len);
 #endif
     if (bytes_needed > WTAP_MAX_PACKET_SIZE) {
-        *err = WTAP_ERR_BAD_RECORD;
+        *err = WTAP_ERR_BAD_FILE;
         g_snprintf(err_str, 100, "Bad packet length: %d (%04x)", bytes_needed, bytes_needed);
         *err_info = err_str;
         return FALSE;
@@ -996,7 +996,7 @@ load_cap_file(capture_file *cf)
                            cf->filename);
                 break;
 
-            case WTAP_ERR_BAD_RECORD:
+            case WTAP_ERR_BAD_FILE:
                 cmdarg_err("The file \"%s\" appears to be damaged or corrupt.\n(%s)",
                            cf->filename, err_info);
                 break;
@@ -1674,6 +1674,6 @@ cmdarg_err_cont(const char *fmt, ...)
  * indent-tabs-mode: nil
  * End:
  *
- * ex: set shiftwidth=4 tabstop=8 expandtab
+ * ex: set shiftwidth=4 tabstop=8 expandtab:
  * :indentSize=4:tabSize=8:noTabs=true:
  */