Commit Diff


commit - 0c9b1cfd36c0d05942fa0e65d75536a4dc6ce748
commit + caaad6cc0ef9c3816363b7795641aaa5f4740934
blob - d5622d190215cff29e190bac9443971f3ea333ae
blob + b13780e301a8338e272953415bb7f4951764d0ea
--- apmtop.c
+++ apmtop.c
@@ -158,7 +158,7 @@ cputemp (void)
 
 	ret = sysctl (mib, 5, &sensor, &len, NULL, 0);
 
-	return (ret == -1 || sensor.status & SENSOR_FINVALID) ? -1 : sensor.value / 10000000;
+	return (ret == -1 || sensor.status & SENSOR_FINVALID) ? -1 : ((sensor.value - 273150000) / 1000000);
 }
 
 static int
@@ -259,7 +259,7 @@ draw_graph (struct graph *g, const char *fmt, int min,
 	w -= 2;
 	h -= 3;
 
-	wclear (g->win);
+	werase (g->win);
 
 	for (int i = 0; i < entries; ++i) {
 		int v = g->log[i];
@@ -287,7 +287,7 @@ draw_graph (struct graph *g, const char *fmt, int min,
 static void
 draw (struct display *dpy)
 {
-	clear ();
+	erase ();
 
 	draw_graph (&dpy->g[G_CPUUSAGE],	"CPU: %d%%",	0, 100);
 	draw_graph (&dpy->g[G_CPUTEMP],		"CPU: %d C",	0, 100);
@@ -302,12 +302,10 @@ draw (struct display *dpy)
 
 	printw (" %c delay=%d", dpy->running ? 'R' : 'S', dpy->delay);
 
-	refresh ();
+	wnoutrefresh (stdscr);
 	for (int i = 0; i < NGRAPH; ++i)
 		wnoutrefresh (dpy->g[i].win);
 	doupdate ();
-	move (0, 0);
-
 }
 
 static void