From 33fb2bed58e9f4dfadd2f69f90e474fd46099419 Mon Sep 17 00:00:00 2001 From: "Kelvin M. Klann" Date: Fri, 16 Jun 2023 16:02:43 -0300 Subject: Deduplicate calls similar to errExit Use errExit in every place that uses __FILE__ and __LINE__ manually. Note: This currently only happens in the duplicated `is_dir` function. --- src/ftee/main.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'src/ftee/main.c') diff --git a/src/ftee/main.c b/src/ftee/main.c index a34a76b26..20e25c202 100644 --- a/src/ftee/main.c +++ b/src/ftee/main.c @@ -148,10 +148,8 @@ static int is_dir(const char *fname) { rv = stat(fname, &s); else { char *tmp; - if (asprintf(&tmp, "%s/", fname) == -1) { - fprintf(stderr, "Error: cannot allocate memory, %s:%d\n", __FILE__, __LINE__); - exit(1); - } + if (asprintf(&tmp, "%s/", fname) == -1) + errExit("asprintf"); rv = stat(tmp, &s); free(tmp); } -- cgit v1.2.3-54-g00ecf