From 9d77441a738001a118128cdb30be3822eddcbcb3 Mon Sep 17 00:00:00 2001 From: Ryan Thomas McBride Date: Wed, 18 Jul 2007 13:34:24 +0000 Subject: Fix uninitialised variable 'sum' in single-processor idle calculation. ok ckuethe, sturm --- usr.sbin/apmd/apmd.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/usr.sbin/apmd/apmd.c b/usr.sbin/apmd/apmd.c index a96d7a9f155..0578bee4580 100644 --- a/usr.sbin/apmd/apmd.c +++ b/usr.sbin/apmd/apmd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: apmd.c,v 1.47 2007/06/03 22:14:07 tedu Exp $ */ +/* $OpenBSD: apmd.c,v 1.48 2007/07/18 13:34:23 mcbride Exp $ */ /* * Copyright (c) 1995, 1996 John T. Kohl @@ -272,7 +272,7 @@ get_avg_idle_up(void) long change, cp_time[CPUSTATES]; int cp_time_mib[] = {CTL_KERN, KERN_CPTIME}; size_t cp_time_sz = sizeof(cp_time); - int i, idle, sum; + int i, idle, sum = 0; if (sysctl(cp_time_mib, 2, &cp_time, &cp_time_sz, NULL, 0) < 0) syslog(LOG_INFO, "cannot read kern.cp_time"); -- cgit v1.2.3