ubase

suckless linux base utils
git clone git://git.2f30.org/ubase.git
Log | Files | Refs | README | LICENSE

commit 131cc5da8e1c8db28426bd6f5a3acf8a5f213835
parent e7b70ff9976cefc320e4f0f8471e4136b141c84b
Author: Hiltjo Posthuma <hiltjo@codemadness.org>
Date:   Fri Feb 20 16:14:11 +0100

mount: catfile: return 0 or -1

Diffstat:
mount.c | 6+++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/mount.c b/mount.c @@ -106,10 +106,10 @@ catfile(FILE *in, FILE *out) while (!feof(in)) { bytesread = fread(buf, 1, sizeof(buf), in); if (ferror(in)) - return 0; + return -1; fwrite(buf, 1, bytesread, out); } - return 1; + return 0; } static void @@ -160,7 +160,7 @@ main(int argc, char *argv[]) if (argc < 1 && aflag == 0) { if (!(fp = fopen(files[0], "r"))) eprintf("fopen %s:", files[0]); - if (catfile(fp, stdout) != 1) { + if (catfile(fp, stdout) == -1) { weprintf("error while reading %s:", files[0]); status = 1; }