Hello community, here is the log from the commit of package procinfo checked in at Mon Jul 30 21:00:12 CEST 2007. -------- --- procinfo/procinfo.changes 2007-06-05 14:50:57.000000000 +0200 +++ /mounts/work_src_done/STABLE/procinfo/procinfo.changes 2007-07-30 17:11:18.228334000 +0200 @@ -1,0 +2,6 @@ +Mon Jul 30 17:09:25 CEST 2007 - werner@suse.de + +- During time delay calculation cast result not parts to float and + avoid sprint overflows (bug #295501) + +------------------------------------------------------------------- New: ---- procinfo-float.dif ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ procinfo.spec ++++++ --- /var/tmp/diff_new_pack.t29342/_old 2007-07-30 20:58:51.000000000 +0200 +++ /var/tmp/diff_new_pack.t29342/_new 2007-07-30 20:58:51.000000000 +0200 @@ -13,11 +13,11 @@ Name: procinfo BuildRequires: ncurses-devel URL: ftp://ftp.cistron.nl/pub/people/svm/ -License: GNU General Public License (GPL) +License: GPL v2 or later Group: System/Monitoring Autoreqprov: on Version: 18 -Release: 104 +Release: 116 Summary: Display System Status Gathered from /proc Provides: ps:/usr/bin/lsdev Source: ftp://ftp.cistron.nl/pub/people/svm/%{name}-%{version}.tar.bz2 @@ -31,6 +31,7 @@ Patch7: procinfo-loadavg.dif Patch8: procinfo-lsdev.dif Patch9: procinfo-socklist.dif +Patch10: procinfo-float.dif BuildRoot: %{_tmppath}/%{name}-%{version}-build %description @@ -55,6 +56,7 @@ %patch7 %patch8 %patch9 +%patch10 %build CFLAGS="-D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 ${RPM_OPT_FLAGS} -pipe" @@ -79,6 +81,9 @@ %{_mandir}/man8/socklist.8* %changelog +* Mon Jul 30 2007 - werner@suse.de +- During time delay calculation cast result not parts to float and + avoid sprint overflows (bug #295501) * Tue Jun 05 2007 - werner@suse.de - Correct patch depth * Mon Jun 04 2007 - werner@suse.de ++++++ procinfo-float.dif ++++++ --- procinfo.c +++ procinfo.c 2007-07-30 16:53:29.249722825 +0200 @@ -186,7 +186,7 @@ first_page (long sl) the DIFF macro, so that we'll end up with nice multiples of 4 when using the -d option. */ -#define rate (sl>1000000 ? sl/1000000 : 1) +#define rate (sl>1000000 ? (float)(sl/1000000) : (float)1.0) printf ("Mem: %12ld%12ld%12ld%12ld%12ld", DIFF (m_to), DIFF (m_us), DIFF (m_fr), DIFF (m_sh), DIFF (m_bu)); if (have_m_c) @@ -1060,8 +1060,8 @@ main (int ac, char **av) then = now; gettimeofday (&now, 0); if (per_sec) - rate = (float) now.tv_sec + (float) now.tv_usec / 1.0e6 - - (float) then.tv_sec - (float) then.tv_usec / 1.0e6; + rate = (float)((now.tv_sec + (now.tv_usec /1000000)) - + (then.tv_sec + (then.tv_usec/1000000))); } else { putchar ('\n'); --- routines.c +++ routines.c 2007-07-30 16:50:08.564263479 +0200 @@ -388,7 +388,7 @@ hms (unsigned long t) { unsigned int d, h, m, s; - static char buf[22]; + static char buf[256]; t = (t*100ULL) / usr_hz; d = (unsigned int) (t / 8640000); @@ -400,9 +400,11 @@ s = (unsigned int) (t / 100); t = t - (unsigned long) (s * 100); if (d > 0) - sprintf (buf, "%3ud %2u:%02u:%02u.%02u", d, h, m, s, (unsigned int) t); + snprintf (buf, sizeof(buf)-1, + "%3ud %2u:%02u:%02u.%02u", d, h, m, s, (unsigned int) t); else - sprintf (buf, " %2u:%02u:%02u.%02u", h, m, s, (unsigned int) t); + snprintf (buf, sizeof(buf)-1, + " %2u:%02u:%02u.%02u", h, m, s, (unsigned int) t); return buf; } @@ -411,7 +413,7 @@ perc (unsigned long i, unsigned long t, int cpus) { unsigned int v; - static char buf[16]; + static char buf[128]; if ((signed long) i == -1 || t == 0) return "---.-%"; @@ -424,7 +426,7 @@ /* if (v > 1000) return "+++.+%"; else */ - sprintf (buf, "%3u.%u%%", v / 10, v % 10); + snprintf (buf, sizeof(buf)-1, "%3u.%u%%", v / 10, v % 10); return buf; } ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Remember to have fun... --------------------------------------------------------------------- To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-commit+help@opensuse.org