aboutsummaryrefslogtreecommitdiffstats
path: root/src/nnn.c
diff options
context:
space:
mode:
authorGravatar Sijmen J. Mulder <ik@sjmulder.nl>2019-06-13 01:07:03 +0200
committerGravatar Sijmen J. Mulder <ik@sjmulder.nl>2019-06-13 01:07:03 +0200
commitda60f55559f5e83753a39d0b4a7e88c5c26aef32 (patch)
treebfdf81d37986d53ef78024c38223d84e339460c0 /src/nnn.c
parent331d2a6cc5e275f85df345adc4f22ced5c717bd0 (diff)
downloadnnn-da60f55559f5e83753a39d0b4a7e88c5c26aef32.tar.gz
Don't ignore fwrite errors
Fixes warning on CentOS 6: src/nnn.c:754: warning: ignoring return value of 'fwrite', declared with attribute warn_unused_result
Diffstat (limited to 'src/nnn.c')
-rw-r--r--src/nnn.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/nnn.c b/src/nnn.c
index 869d5b7..6bdfd20 100644
--- a/src/nnn.c
+++ b/src/nnn.c
@@ -745,9 +745,9 @@ static void writecp(const char *buf, const size_t buflen)
return;
FILE *fp = fopen(g_cppath, "w");
-
if (fp) {
- fwrite(buf, 1, buflen, fp);
+ if (fwrite(buf, 1, buflen, fp) != buflen)
+ printwarn(NULL);
fclose(fp);
} else
printwarn(NULL);