[Xfce4-commits] <xfce4-cpugraph-plugin:master> Fix bug 4791
Florian
noreply at xfce.org
Sat Apr 17 16:16:16 CEST 2010
Updating branch refs/heads/master
to 6de8646914b9abf644a72c9dc98fd8b5d1b24b4d (commit)
from 73b4623d1b08458d682fafdf9f81feb50c135457 (commit)
commit 6de8646914b9abf644a72c9dc98fd8b5d1b24b4d
Author: Florian Rivoal <frivoal at gmail.com>
Date: Fri Feb 19 10:07:00 2010 +0900
Fix bug 4791
A type mistake in a printf was causing floating point numbers to be
missinterpreted as integers, causing seemingly random values to be
displayed in the tooltip.
panel-plugin/cpu.c | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/panel-plugin/cpu.c b/panel-plugin/cpu.c
index 3e6cbf3..89e9eaa 100644
--- a/panel-plugin/cpu.c
+++ b/panel-plugin/cpu.c
@@ -170,10 +170,10 @@ void SetOrientation( XfcePanelPlugin * plugin, GtkOrientation orientation, CPUGr
void UpdateTooltip( CPUGraph * base )
{
- char tooltip[32];
- int pos = snprintf( tooltip, 32, "Usage: %d%%", base->m_CpuData[0].load*100/CPU_SCALE );
+ gchar tooltip[32];
+ int pos = g_snprintf( tooltip, 32, "Usage: %d%%", (int)base->m_CpuData[0].load*100/CPU_SCALE );
if( base->m_CpuData[0].scalCurFreq )
- snprintf( tooltip+pos, 32-pos, " (%d MHz)", base->m_CpuData[0].scalCurFreq/1000 );
+ g_snprintf( tooltip+pos, 32-pos, " (%d MHz)", base->m_CpuData[0].scalCurFreq/1000 );
gtk_tooltips_set_tip( GTK_TOOLTIPS( base->m_Tooltip ), base->m_FrameWidget->parent, tooltip, NULL );
}
More information about the Xfce4-commits
mailing list