From be6f276557ab85cef4a8d681b2970990070d05c9 Mon Sep 17 00:00:00 2001 From: Joachim Nilsson Date: Tue, 31 Oct 2017 00:33:19 +0100 Subject: [PATCH] Fix #7: inconsistent return value in mkpath() When the required `dir` argument is missing `mkpath()` inconsistently returns 1 instead of -1. Found by @jesponde Signed-off-by: Joachim Nilsson --- makepath.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/makepath.c b/makepath.c index 7c57796..a78c2cc 100644 --- a/makepath.c +++ b/makepath.c @@ -35,7 +35,7 @@ int mkpath(char *dir, mode_t mode) if (!dir) { errno = EINVAL; - return 1; + return -1; } if (!stat(dir, &sb))