85dc249d41
In addition to the standard bugfixes, this is a major port rewrite. The port now uses a '_ups' user and the CGIs created can now run under either chrooted Apache or non-chrooted Apache.
40 lines
2.0 KiB
Plaintext
40 lines
2.0 KiB
Plaintext
$OpenBSD: patch-drivers_tripplite_c,v 1.1 2004/02/09 06:48:48 marcm Exp $
|
|
--- drivers/tripplite.c.orig 2004-01-03 10:23:48.000000000 -0800
|
|
+++ drivers/tripplite.c 2004-01-03 10:25:55.000000000 -0800
|
|
@@ -322,7 +322,7 @@ void upsdrv_updateinfo(void)
|
|
switch (buf[0]) {
|
|
case '0': status_set("LB"); break; /* Low Battery */
|
|
case '1': break; /* Normal */
|
|
- default: sprintf(temp, "BAT-%c?", buf[0]);
|
|
+ default: snprintf(temp, sizeof (temp), "BAT-%c?", buf[0]);
|
|
status_set(temp);
|
|
break; /* Unknown */
|
|
}
|
|
@@ -331,7 +331,7 @@ void upsdrv_updateinfo(void)
|
|
switch (buf[1]) {
|
|
case '0': status_set("OVER"); break; /* Overload */
|
|
case '1': break; /* Normal */
|
|
- default: sprintf(temp, "LOAD-%c?", buf[1]);
|
|
+ default: snprintf(temp, sizeof (temp), "LOAD-%c?", buf[1]);
|
|
status_set(temp);
|
|
break; /* Unknown */
|
|
}
|
|
@@ -342,7 +342,7 @@ void upsdrv_updateinfo(void)
|
|
case '1': status_set("TRIM"); break; /* Reducing */
|
|
case '2': status_set("BOOST"); break; /* Boost */
|
|
case '3': status_set("BOOST"); break; /* Extra Boost */
|
|
- default: sprintf(temp, "TAP-%c?", buf[4]);
|
|
+ default: snprintf(temp, sizeof (temp), "TAP-%c?", buf[4]);
|
|
status_set(temp);
|
|
break; /* Unknown */
|
|
}
|
|
@@ -353,7 +353,7 @@ void upsdrv_updateinfo(void)
|
|
case '1': status_set("OB"); break; /* On Battery */
|
|
case '2': status_set("OL"); break; /* On Line */
|
|
case '3': status_set("OB"); break; /* On Battery */
|
|
- default: sprintf(temp, "MODE-%c?", buf[5]);
|
|
+ default: snprintf(temp, sizeof (temp), "MODE-%c?", buf[5]);
|
|
status_set(temp);
|
|
break; /* Unknown */
|
|
}
|