summaryrefslogtreecommitdiff
path: root/battstat/apmlib/apmlib.c
diff options
context:
space:
mode:
authorrbuj <[email protected]>2020-07-27 08:46:27 +0200
committerraveit65 <[email protected]>2020-08-07 14:45:01 +0200
commitde05d11aadbb0881613df6dbf13717781930a22b (patch)
tree5ed75ef9f90d22eb615e3872ca4fa4eb379ce4e1 /battstat/apmlib/apmlib.c
parent5cbe2698bd1b575774b33e28ab365e0695313e88 (diff)
downloadmate-applets-de05d11aadbb0881613df6dbf13717781930a22b.tar.bz2
mate-applets-de05d11aadbb0881613df6dbf13717781930a22b.tar.xz
battstat: invalidScanfArgType_int cppcheck warnings (/proc/apm)
Diffstat (limited to 'battstat/apmlib/apmlib.c')
-rw-r--r--battstat/apmlib/apmlib.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/battstat/apmlib/apmlib.c b/battstat/apmlib/apmlib.c
index 0e9946cd..e15bb541 100644
--- a/battstat/apmlib/apmlib.c
+++ b/battstat/apmlib/apmlib.c
@@ -68,7 +68,7 @@ int apm_read(apm_info * i)
/* Should check for other driver versions; driver 1.9 (and some
* others) uses this format, which doesn't expose # batteries.
*/
- sscanf(buffer, "%s %d.%d %x %x %x %x %d%% %d %s\n",
+ sscanf(buffer, "%s %d.%d %hx %hx %hx %hx %d%% %d %s\n",
(char *) i->driver_version,
&i->apm_version_major,
&i->apm_version_minor,
@@ -102,7 +102,7 @@ int apm_read(apm_info * i)
if (fgets(buffer, sizeof(buffer) - 1, str) == NULL)
printf("fgets error\n");
- sscanf(buffer, "Flags: 0x%02x", &i->apm_flags);
+ sscanf(buffer, "Flags: 0x%02hx", &i->apm_flags);
if (i->apm_flags & APM_32_BIT_SUPPORT)
{
if (fgets(buffer, sizeof(buffer) - 1, str) == NULL)
@@ -142,7 +142,7 @@ int apm_read(apm_info * i)
if (fgets(buffer, sizeof(buffer) - 1, str) == NULL)
printf("fgets error\n");
- sscanf(buffer, "Battery flag: 0x%02x", &i->battery_flags);
+ sscanf(buffer, "Battery flag: 0x%02hx", &i->battery_flags);
if (fgets(buffer, sizeof(buffer) - 1, str) == NULL)
printf("fgets error\n");