Ethereal-dev: [Ethereal-dev] Patch for editcap.c

Note: This archive is from the project's previous web site, ethereal.com. This list is no longer active.

From: Peter Johansson <Peter.Johansson@xxxxxxxxxxxx>
Date: Mon, 25 Jul 2005 23:24:33 +0200
The supplied patch takes care of the following compilation warnings:

editcap.c(273) : warning C4013: 'getpid' undefined; assuming extern returning int
editcap.c(464) : warning C4018: '<' : signed/unsigned mismatch

/ Peter
Index: I:/ethereal-win32-libs/editcap.c
===================================================================
--- I:/ethereal-win32-libs/editcap.c	(revision 15066)
+++ I:/ethereal-win32-libs/editcap.c	(working copy)
@@ -32,6 +32,10 @@
 #include "getopt.h"
 #endif
 
+#ifdef _WIN32
+#include <process.h>    /* getpid */
+#endif
+
 /*
  * Some globals so we can pass things to various routines
  */
@@ -461,7 +465,7 @@
               }
 
               if (err_type < ERR_WT_FMT) {
-                if (i < phdr->caplen - 2)
+                if ((unsigned int)i < phdr->caplen - 2)
                   strcpy(&buf[i],  "%s");
                 err_type = ERR_WT_TOTAL;
               } else {