Don't sanity-check snaplen against frame length if snaplen is 0.
authorMartin Mathieson <martin.r.mathieson@googlemail.com>
Wed, 20 Jul 2011 12:24:41 +0000 (12:24 -0000)
committerMartin Mathieson <martin.r.mathieson@googlemail.com>
Wed, 20 Jul 2011 12:24:41 +0000 (12:24 -0000)
svn path=/trunk/; revision=38132

editcap.c

index 8481e7367361eeb758ee8d1886ef534ad22c3d5a..7a3363ad7b02f2d76ca4b3dedc28a99b6a472dc7 100644 (file)
--- a/editcap.c
+++ b/editcap.c
@@ -1444,7 +1444,7 @@ main(int argc, char *argv[])
           }
         }
 
-        if(phdr->caplen > wtap_snapshot_length(wth)) {
+        if((wtap_snapshot_length(wth) != 0) && (phdr->caplen > wtap_snapshot_length(wth))) {
             fprintf(stderr, "Warning: packet %d too big for file type, skipping it...\n", count);
             count++;
             continue;