From 40f78b11c4698fecabb77e37c2e193520f17688d Mon Sep 17 00:00:00 2001 From: Philip Kovacs Date: Fri, 1 Sep 2006 17:00:53 +0000 Subject: [PATCH] fix type-punning warnings with -fstrict-aliasing (active with gcc-4.1 -O2) git-svn-id: https://conky.svn.sourceforge.net/svnroot/conky/trunk/conky1@698 7f574dfc-610e-0410-a909-a81674777703 --- src/libtcp-portmon.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/libtcp-portmon.c b/src/libtcp-portmon.c index 22b2a347..97bb4b71 100644 --- a/src/libtcp-portmon.c +++ b/src/libtcp-portmon.c @@ -827,9 +827,9 @@ void update_tcp_port_monitor_collection( /* read all tcp connections */ while (fgets (buf, sizeof (buf), fp) != NULL) { - if ( sscanf (buf, "%*d: %lx:%hx %lx:%hx %lx %*x:%*x %*x:%*x %*x %lu %*d %lu", - (unsigned long *)&conn.local_addr, &conn.local_port, - (unsigned long *)&conn.remote_addr, &conn.remote_port, + if ( sscanf (buf, "%*d: %x:%hx %x:%hx %lx %*x:%*x %*x:%*x %*x %lu %*d %lu", + (unsigned int *)&conn.local_addr, &conn.local_port, + (unsigned int *)&conn.remote_addr, &conn.remote_port, (unsigned long *)&state, (unsigned long *)&uid, (unsigned long *)&inode) != 7 ) fprintf( stderr, "/proc/net/tcp: bad file format\n" );