From: Mart Lubbers Date: Wed, 27 Jan 2016 20:53:13 +0000 (+0100) Subject: correct errno to boolean X-Git-Tag: v0.4~4 X-Git-Url: https://git.martlubbers.net/?a=commitdiff_plain;h=4809a88897173cecff92433816e872b505426f88;p=CleanReadLine.git correct errno to boolean --- diff --git a/Clean System Files/readLine.c b/Clean System Files/readLine.c index c73bc06..e3f4def 100644 --- a/Clean System Files/readLine.c +++ b/Clean System Files/readLine.c @@ -247,7 +247,7 @@ int cleanReadHistory(CleanString path) char *cs_path = cleanStringToCString(path); int errno = read_history(cs_path); free(cs_path); - return errno; + return errno == 0; } int cleanReadHistoryRange(CleanString path, int from, int to) @@ -255,7 +255,7 @@ int cleanReadHistoryRange(CleanString path, int from, int to) char *cs_path = cleanStringToCString(path); int errno = read_history_range(cs_path, from, to); free(cs_path); - return errno; + return errno == 0; } int cleanWriteHistory(CleanString path) @@ -263,7 +263,7 @@ int cleanWriteHistory(CleanString path) char *cs_path = cleanStringToCString(path); int errno = write_history(cs_path); free(cs_path); - return errno; + return errno == 0; } int cleanAppendHistory(int n, CleanString path) @@ -271,7 +271,7 @@ int cleanAppendHistory(int n, CleanString path) char *cs_path = cleanStringToCString(path); int errno = append_history(n, cs_path); free(cs_path); - return errno; + return errno == 0; } int cleanHistoryTruncateFile(CleanString path, int nlines) @@ -279,5 +279,5 @@ int cleanHistoryTruncateFile(CleanString path, int nlines) char *cs_path = cleanStringToCString(path); int errno = history_truncate_file(cs_path, nlines); free(cs_path); - return errno; + return errno == 0; }