ongrep

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

commit 4ffce1f06c6bcf6e1e5566b6fd6410cee9bc0b0e
parent 153b59e895f2b93c3ab1d0c8f307c4947a76a8c3
Author: Jordan Ritter <jpr5@darkridge.com>
Date:   Fri, 18 Jul 2014 17:41:14 -0700

Avert warnings: cast malloc retval

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

diff --git a/ngrep.c b/ngrep.c @@ -480,7 +480,7 @@ int main(int argc, char **argv) { clean_exit(-1); } - bin_data = malloc(len / 2); + bin_data = (char*)malloc(len / 2); memset(bin_data, 0, len / 2); d = bin_data; @@ -536,7 +536,7 @@ int main(int argc, char **argv) { #endif if (re_match_word) { - char *word_regex = malloc(strlen(match_data) * 3 + strlen(WORD_REGEX)); + char *word_regex = (char*)malloc(strlen(match_data) * 3 + strlen(WORD_REGEX)); sprintf(word_regex, WORD_REGEX, match_data, match_data, match_data); match_data = word_regex; }