Removed second include <epan/packet.h>.
[obnox/wireshark/wip.git] / epan / dissectors / packet-memcache.c
index ebe47f88b02c413c74267523d8acad2d84dd2d76..e740390399d52b80554727f6fbe1f58b45662023 100644 (file)
 #include "config.h"
 #endif
 
+#include <stdio.h>
+#include <stdlib.h>
 #include <string.h>
 #include <ctype.h>
-
 #include <glib.h>
+
 #include <epan/conversation.h>
 #include <epan/packet.h>
 #include <epan/strutil.h>
 #include <epan/base64.h>
 #include <epan/emem.h>
 #include <epan/stats_tree.h>
-
 #include <epan/req_resp_hdrs.h>
-
-#include <epan/packet.h>
 #include <epan/prefs.h>
 #include <epan/expert.h>
 
@@ -383,7 +382,7 @@ dissect_extras (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
 
 static void 
 dissect_key (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, 
-             gint offset, guint16 key_len, guint8 opcode, gboolean request)
+             gint offset, int key_len, guint8 opcode, gboolean request)
 {
   proto_item *ti = NULL;
   gboolean    illegal = FALSE;  /* Set when key shall not be present */
@@ -619,7 +618,7 @@ get_payload_length (tvbuff_t *tvb, const int token_number, int offset,
 {
   const guchar *next_token;
   const guchar *line, *lineend;
-  gchar        *bytes_val;
+  guchar       *bytes_val;
   int           tokenlen, i = 0, linelen;
   gint          next_offset;
 
@@ -1329,9 +1328,7 @@ memcache_response_dissector (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree
 
     /* CRLF */
     tokenlen = get_token_len (line, lineend, &next_token);
-    if (tokenlen == 0) {
-      return offset;
-    } else {
+    if (tokenlen != 0) {
       /* invalid token */
       return -1;
     }
@@ -2043,7 +2040,7 @@ proto_register_memcache (void)
 
     { &hf_extras_unknown,
       { "Unknown", "memcache.extras.unknown", 
-        FT_BYTES, BASE_DEC, NULL, 0x0, 
+        FT_BYTES, BASE_NONE, NULL, 0x0, 
         "Unknown Extras", HFILL } },
 
     { &hf_extras_missing,
@@ -2053,7 +2050,7 @@ proto_register_memcache (void)
 
     { &hf_key,
       { "Key", "memcache.key", 
-        FT_STRING, BASE_DEC, NULL, 0x0, 
+        FT_STRING, BASE_NONE, NULL, 0x0, 
         NULL, HFILL } },
 
     { &hf_key_missing,
@@ -2063,7 +2060,7 @@ proto_register_memcache (void)
 
     { &hf_value,
       { "Value", "memcache.value", 
-        FT_STRING, BASE_DEC, NULL, 0x0, 
+        FT_STRING, BASE_NONE, NULL, 0x0, 
         NULL, HFILL } },
 
     { &hf_value_missing,
@@ -2184,6 +2181,6 @@ proto_reg_handoff_memcache (void)
  * indent-tabs-mode: nil
  * End:
  *
- * ex: set shiftwidth=2 tabstop=2 noexpandtab
- * :indentSize=2:tabSize=2:noTabs=false:
+ * ex: set shiftwidth=2 tabstop=2 expandtab
+ * :indentSize=2:tabSize=2:noTabs=true:
  */