ongrep

A cleaned up fork of ngrep for OpenBSD
git clone git://git.sgregoratto.me/ongrep
Log | Files | Refs | README | LICENSE

commit 91030f81c629bed08a2bb7c4c8e4e46b599e6db3
parent e29fc29f2caafe3aa3719920215300b9d007d24e
Author: Jordan Ritter <jpr5@darkridge.com>
Date:   Thu, 30 Jun 2005 14:44:07 +0000

atoi is signed

Diffstat:
Mngrep.c | 6+++---
1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/ngrep.c b/ngrep.c @@ -1339,12 +1339,12 @@ void win32_listdevices(void) { } char *win32_usedevice(const char *index) { - uint32_t idx = atoi(index), i = 0; + int32_t idx = atoi(index), i = 0; pcap_if_t *alldevs, *d; char errbuf[PCAP_ERRBUF_SIZE]; char *dev = NULL; - if (idx == 0) { + if (idx <= 0) { perror("invalid device index"); clean_exit(-1); } @@ -1358,7 +1358,7 @@ char *win32_usedevice(const char *index) { if (++i == idx) dev = _strdup(d->name); - if (i == 0) { + if (i <= 0) { perror("no known devices"); clean_exit(-1); }