rpms/nc/devel nc-1.84-gcc4.3.patch,NONE,1.1 nc.spec,1.38,1.39

Jan Šafránek (jsafrane) fedora-extras-commits at redhat.com
Mon Jan 7 14:43:46 UTC 2008


Author: jsafrane

Update of /cvs/pkgs/rpms/nc/devel
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv10103

Modified Files:
	nc.spec 
Added Files:
	nc-1.84-gcc4.3.patch 
Log Message:
fixed compilation with gcc 4.3

nc-1.84-gcc4.3.patch:

--- NEW FILE nc-1.84-gcc4.3.patch ---
Fix compilation warnings found by new gcc 4.3.

1) netcat.c:125: error: 'proxy' may be used uninitialized in this function
2) netcat.c:791: error: the address of 'obuf' will always evaluate as 'true'

Written-by: Jan Safranek <jsafrane at redhat.com>

--- nc/netcat.c.orig	2008-01-07 13:50:55.000000000 +0100
+++ nc/netcat.c	2008-01-07 14:00:44.000000000 +0100
@@ -122,7 +122,7 @@ main(int argc, char *argv[])
 	struct servent *sv;
 	socklen_t len;
 	struct sockaddr_storage cliaddr;
-	char *proxy;
+	char *proxy = NULL;
 	const char *proxyhost = "", *proxyport = NULL;
 	struct addrinfo proxyhints;
 
@@ -788,14 +788,12 @@ atelnet(int nfd, unsigned char *buf, uns
 			obuf[1] = DONT;
 		if ((*p == DO) || (*p == DONT))
 			obuf[1] = WONT;
-		if (obuf) {
-			p++;
-			obuf[2] = *p;
-			obuf[3] = '\0';
-			if (atomicio(vwrite, nfd, obuf, 3) != 3)
-				warn("Write Error!");
-			obuf[0] = '\0';
-		}
+		p++;
+		obuf[2] = *p;
+		obuf[3] = '\0';
+		if (atomicio(vwrite, nfd, obuf, 3) != 3)
+			warn("Write Error!");
+		obuf[0] = '\0';
 	}
 }
 


Index: nc.spec
===================================================================
RCS file: /cvs/pkgs/rpms/nc/devel/nc.spec,v
retrieving revision 1.38
retrieving revision 1.39
diff -u -r1.38 -r1.39
--- nc.spec	5 Dec 2007 13:43:48 -0000	1.38
+++ nc.spec	7 Jan 2008 14:43:11 -0000	1.39
@@ -1,7 +1,7 @@
 Summary: Reads and writes data across network connections using TCP or UDP
 Name: nc
 Version: 1.84
-Release: 14%{?dist}
+Release: 15%{?dist}
 URL:	 http://www.openbsd.org/cgi-bin/cvsweb/src/usr.bin/nc/
 # source is CVS checkout
 Source0: nc-%{version}.tar.bz2
@@ -15,6 +15,8 @@
 Patch7: nc-1.84-crlf.patch
 Patch8: nc-1.84-verb.patch
 Patch9: nc-1.84-man.patch
+Patch10: nc-1.84-gcc4.3.patch
+
 License: GPL+
 Group: Applications/Internet
 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
@@ -46,6 +48,7 @@
 %patch7 -p1 -b .crlf
 %patch8 -p1 -b .verb
 %patch9 -p1 -b .man
+%patch10 -p1 -b .gcc
 
 %build
 gcc $RPM_OPT_FLAGS -Werror `pkg-config --cflags --libs glib-2.0` netcat.c atomicio.c socks.c -o nc
@@ -67,6 +70,9 @@
 %doc README scripts
 
 %changelog
+* Mon Jan  7 2008 Jan Safranek <jsafrane at redhat.com> - 1.84-15
+- fixed compilation with gcc 4.3
+
 * Wed Dec  5 2007 Radek Vokál <rvokal at redhat.com> - 1.84-14
 - rebuilt
 




More information about the fedora-extras-commits mailing list