search for: snprintfcat

Displaying 6 results from an estimated 6 matches for "snprintfcat".

2012 Jul 03
2
[Patch] upssched broken in version 2.6.4 with command with two arguments
Hi, the last commit to upssched.c (Merge Coverity branch, r3555) broke upssched with commands that have a second argument. If a command with a second argument is used, "enc" in line 697 is not an empty buffer and snprintfcat() just appends some stuff, i.e. the following command CANCEL onbatt online becomes onlineCANCEL "onbatt" "online" and is then sent to the pipe-fd. The attached patch replaces snprintfcat() with snprintf() and fixes the problem. Best, Oliver -- Oliver Schonefeld Institut...
2023 May 24
1
Synthesize low batt (LB) fron SNMP UPS which does not support this?
...low = dstate_getinfo("battery.charge.low"); - + upsdebugx(2, "%s: charge val/low %s/%s']", __func__, val, low); if (val && low && (strtol(val, NULL, 10) < strtol(low, NULL, 10))) { snprintfcat(status_buf, sizeof(status_buf), " LB"); upsdebugx(2, "%s: appending LB flag [charge '%s' below '%s']", __func__, val, low); @@ -1127,6 +1131,7 @@ val = dstate_getinfo("battery.runtime"); low =...
2023 May 24
1
Synthesize low batt (LB) fron SNMP UPS which does not support this?
...low = dstate_getinfo("battery.charge.low"); > - > + upsdebugx(2, "%s: charge val/low %s/%s']", __func__, val, low); > if (val && low && (strtol(val, NULL, 10) < strtol(low, NULL, 10))) { > snprintfcat(status_buf, sizeof(status_buf), " LB"); > upsdebugx(2, "%s: appending LB flag [charge '%s' below '%s']", __func__, val, low); > @@ -1127,6 +1131,7 @@ > > val = dstate_getinfo("battery.runtime"); >...
2013 Oct 17
0
UPSC based Windows Client
...rstand your question here. If you are referring to the UPS variables, there is no guarantee that a specific variable will be available (except "ups.status"; think of a contact-closure UPS which can only report OL/OB/LB). As an aside, in upsc.c, you use sprintf() with strlen(). There is a snprintfcat() utility in common/common.c > I tried not to violate any licence and only re-use freeware, but don't fully comprehend these licences. Can these licences collide? They can, potentially. The one thing I spot-checked was the icon page, and I didn't see any license information there. >...
2013 Oct 14
3
UPSC based Windows Client
[attachments trimmed] Begin forwarded message: > From: eric kreuwels > Subject: UPSC based Windows Client > Date: October 13, 2013 4:43:31 PM EDT > To: nut-upsdev at lists.alioth.debian.org > > > Dear developers > > Last month I wrote WinUPSC, a Windows task tray UPS monitor. WinUPSC re-uses the UPSC logic to poll the UPS. > This initial version was tested
2023 May 22
2
Synthesize low batt (LB) fron SNMP UPS which does not support this?
Hmm. Is there maybe something there already that will do this? Maybe kind of back-handed. In drivers/dstate.c, I see: In status_init(), if ?driver.flag.ignorelb? is set in the driver state, the ?ignorelb? flag is set. In status_set(), if ignorelb is set, and the status being set (presumably from the UPS) is LB, it?s ignored. In other words, LB reported by the UPS is ignored. In status_commit(),