summaryrefslogtreecommitdiff
path: root/sysutils/ups-nut/patches/patch-af
blob: 9936162ecec28c13253fc4b70215288bcebce44e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
$NetBSD: patch-af,v 1.5 2002/12/31 22:47:06 lukem Exp $

--- drivers/newapc.c.orig	Mon Oct  7 14:35:35 2002
+++ drivers/newapc.c
@@ -182,11 +182,16 @@ char * convert_ups2info (struct apc_cmdt
 	case APC_F_CELCIUS:
 	case APC_F_HEX:
 	case APC_F_DEC:
-	case APC_F_SECONDS:
-	case APC_F_HOURS:
 	case APC_F_LEAVE:
 				/* All of these just pass through at present */
 		ptr = upsval;
+		break;
+	case APC_F_SECONDS:
+	case APC_F_HOURS:
+				/* Parse number */
+		tval = strtol(upsval, NULL, 10);
+		sprintf(tmp, "%d", tval);
+		ptr = tmp;
 		break;
 	case APC_F_MINUTES:
 		/* Convert to seconds - NUT standard time measurement */