Package: libnet / 1.1.6+dfsg-3

fix-return-value-ignore Patch series | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
From: Stefanos Harhalakis <v13@v13.gr>
Subject: Assign the returned value to a variable to prevent gcc from warning.

Index: libnet-1.1.6/src/libnet_version.c
===================================================================
--- libnet-1.1.6.orig/src/libnet_version.c	2012-03-19 16:59:50.000000000 +0000
+++ libnet-1.1.6/src/libnet_version.c	2012-06-21 20:44:01.662970535 +0100
@@ -48,11 +48,13 @@
 {
     /*
      *  We don't check for error cos we really don't care.
+     *  but compilation will fail, so store the return value somewhere.
      */
 #if defined (__WIN32__)
      fprintf(stdout, "%s", banner);
 #else
-     (void)write(STDOUT_FILENO, banner, sizeof(banner) - 1);
+     ssize_t n;
+     n=write(STDOUT_FILENO, banner, sizeof(banner) - 1);
 #endif
 }