From a6b09fe3a16d499eeda0ff907b4d80ce3c859eea Mon Sep 17 00:00:00 2001 From: Ali Gholami Rudi Date: Wed, 25 Jan 2012 21:48:25 +0330 Subject: [PATCH] npp: redefine err() in npp.c --- npp.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/npp.c b/npp.c index ce5d23e..d96de5b 100644 --- a/npp.c +++ b/npp.c @@ -1,12 +1,13 @@ /* * neatpp - a small and simple C preprocessor * - * Copyright (C) 2010-2011 Ali Gholami Rudi + * Copyright (C) 2010-2012 Ali Gholami Rudi * * This file is released under GNU GPL version 2. */ #include #include +#include #include #include #include @@ -64,6 +65,16 @@ static int xwrite(int fd, char *buf, int len) return nw; } +void err(char *fmt, ...) +{ + va_list ap; + char msg[512]; + va_start(ap, fmt); + vsprintf(msg, fmt, ap); + va_end(ap); + die(msg); +} + int main(int argc, char *argv[]) { int ofd = 1; -- 2.11.4.GIT