scan ports as short. debian bug# 359974
authorPhilip Kovacs <pkovacs@users.sourceforge.net>
Thu, 30 Mar 2006 01:23:59 +0000 (01:23 +0000)
committerPhilip Kovacs <pkovacs@users.sourceforge.net>
Thu, 30 Mar 2006 01:23:59 +0000 (01:23 +0000)
git-svn-id: https://conky.svn.sourceforge.net/svnroot/conky/trunk/conky1@614 7f574dfc-610e-0410-a909-a81674777703

ChangeLog
src/libtcp-portmon.c

index f15545f..e255209 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
 # $Id$
 
+2006-03-29
+       * Scan port numbers as short.  Fixes debian bug# 359974.
+
 2006-03-25
        * Added XMMS2 patch 1456203 from Lassi Selander
        * Added FreeBSD battery patch 1456008 from Petr Holub
index a39463f..5881cc9 100644 (file)
@@ -816,9 +816,9 @@ void update_tcp_port_monitor_collection(
         /* read all tcp connections */
         while (fgets (buf, sizeof (buf), fp) != NULL) {
 
-                if ( sscanf (buf, "%*d: %lx:%lx %lx:%lx %lx %*x:%*x %*x:%*x %*x %lu %*d %lu",
-                        (unsigned long *)&conn.local_addr, (unsigned long *)&conn.local_port,
-                        (unsigned long *)&conn.remote_addr, (unsigned long *)&conn.remote_port,
+                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,
                         (unsigned long *)&state, (unsigned long *)&uid, (unsigned long *)&inode) != 7 )
 
                         fprintf( stderr, "/proc/net/tcp: bad file format\n" );