summaryrefslogtreecommitdiff
path: root/sysutils/xbatt/patches/patch-ab
blob: c837634aaca8d0ec5b051e7e2ed2e1e26854f811 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
$NetBSD: patch-ab,v 1.3 2008/03/06 17:24:23 hubertf Exp $

--- xbatt.c.orig	1998-09-18 14:03:05.000000000 +0200
+++ xbatt.c
@@ -219,6 +219,7 @@ struct Digits	digits[] = {
 String fallback_resouces[] = {
     "*width: 39",
     "*height: 39",
+    NULL
 };
 
 main(
@@ -494,6 +495,7 @@ struct status getBatteryStatus()
 
 #ifdef __NetBSD__
     struct apm_power_info info;
+    memset(&info, 0, sizeof(info));
     if( ioctl(apmfd, APM_IOC_GETPOWER, &info) == -1 ) {
 	fprintf(stderr, "xbatt: ioctl APM_IOC_GETPOWER failed\n");
 	exit(1);
@@ -686,7 +688,7 @@ void updateWindow(struct status s)
 			   5, 5, 11, 7);
 	}
 
-	if (s.remain == 100) {
+	if (s.remain >= 100) {
 	    bm = XCreatePixmapFromBitmapData(XtDisplay(toplevel),
 					     XtWindow(toplevel),
 					     full_bits, full_width,