Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/crypto/external/bsd/netpgp/dist/src/lib Avoid a warning on G...



details:   https://anonhg.NetBSD.org/src/rev/0088fb1fb521
branches:  trunk
changeset: 326776:0088fb1fb521
user:      agc <agc%NetBSD.org@localhost>
date:      Mon Feb 17 07:39:19 2014 +0000

description:
Avoid a warning on Gentoo Linux about fwrite(3) -- their glibc
declares fwrite(3) with the warn_unused_result attribute, from Razvan
Cojocaru

diffstat:

 crypto/external/bsd/netpgp/dist/src/lib/crypto.c |  9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)

diffs (26 lines):

diff -r dc9d18ee32f5 -r 0088fb1fb521 crypto/external/bsd/netpgp/dist/src/lib/crypto.c
--- a/crypto/external/bsd/netpgp/dist/src/lib/crypto.c  Mon Feb 17 07:34:21 2014 +0000
+++ b/crypto/external/bsd/netpgp/dist/src/lib/crypto.c  Mon Feb 17 07:39:19 2014 +0000
@@ -54,7 +54,7 @@
 
 #if defined(__NetBSD__)
 __COPYRIGHT("@(#) Copyright (c) 2009 The NetBSD Foundation, Inc. All rights reserved.");
-__RCSID("$NetBSD: crypto.c,v 1.35 2011/01/02 18:13:10 agc Exp $");
+__RCSID("$NetBSD: crypto.c,v 1.36 2014/02/17 07:39:19 agc Exp $");
 #endif
 
 #include <sys/types.h>
@@ -286,8 +286,11 @@
                        puts("Skipping...");
                        cbinfo->printstate.skipping = 1;
                }
-               fwrite(content->unarmoured_text.data, 1,
-                      content->unarmoured_text.length, stdout);
+               if (fwrite(content->unarmoured_text.data, 1,
+                      content->unarmoured_text.length, stdout) != content->unarmoured_text.length) {
+                       fprintf(stderr, "unable to write unarmoured text data\n");
+                       cbinfo->printstate.skipping = 1;
+               }
                break;
 
        case PGP_PTAG_CT_PK_SESSION_KEY:



Home | Main Index | Thread Index | Old Index