nnn

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README | LICENSE

commit da60f55559f5e83753a39d0b4a7e88c5c26aef32
parent 331d2a6cc5e275f85df345adc4f22ced5c717bd0
Author: Sijmen J. Mulder <ik@sjmulder.nl>
Date:   Thu, 13 Jun 2019 01:07:03 +0200

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:
Msrc/nnn.c | 4++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git 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);