From a359667f2b65c06aa60915f03bf89708132b1f8b Mon Sep 17 00:00:00 2001 From: Lorenz Kästle Date: Wed, 26 Apr 2023 17:52:22 +0200 Subject: Changing remaining sscanf format specifier to unsigned long --- configure.ac | 10 +++++----- plugins/check_swap.c | 6 +++--- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/configure.ac b/configure.ac index bad5c53c..069cc625 100644 --- a/configure.ac +++ b/configure.ac @@ -1592,13 +1592,13 @@ then grep -E -i "^lswap +path +pri +swaplo +blocks +free +maxswap" \ >/dev/null] then - ac_cv_swap_format=[" %*d %*s %*d,%*d %*d %*d %f %f"] + ac_cv_swap_format=[" %*d %*s %*d,%*d %*d %*d %lu %lu"] ac_cv_swap_conv=2048 AC_MSG_RESULT([using IRIX format swap]) elif [$PATH_TO_SWAP -l 2>/dev/null | grep -E -i "^path +dev +swaplo +blocks +free" >/dev/null] then - ac_cv_swap_format=["%*s %*[0-9,-] %*d %f %f"] + ac_cv_swap_format=["%*s %*[0-9,-] %*d %lu %lu"] ac_cv_swap_conv=2048 AC_MSG_RESULT([using Unixware format swap]) else @@ -1622,7 +1622,7 @@ then if [$PATH_TO_SWAPINFO -k 2>/dev/null | grep -E -i "^Device +1K-blocks +Used +Avail" >/dev/null] then - ac_cv_swap_format=["%*s %f %*d %f"] + ac_cv_swap_format=["%*s %lu %*d %lu"] ac_cv_swap_conv=1024 AC_MSG_RESULT([using FreeBSD format swapinfo]) fi @@ -1631,7 +1631,7 @@ elif [$PATH_TO_SWAPINFO -dfM 2>/dev/null | grep -E -i "^TYPE +AVAIL +USED +FREE" then ac_cv_have_swap=yes ac_cv_swap_command="$PATH_TO_SWAPINFO -dfM" - ac_cv_swap_format=["%*s %f %*d %f"] + ac_cv_swap_format=["%*s %lu %*d %lu"] ac_cv_swap_conv=1024 AC_MSG_RESULT([using HP-UX format swapinfo]) fi @@ -1646,7 +1646,7 @@ if [$PATH_TO_LSPS -a 2>/dev/null | grep -E -i "^Page Space" > /dev/null] then ac_cv_have_swap=yes ac_cv_swap_command="$PATH_TO_LSPS -a" - ac_cv_swap_format=["%*s %*s %*s %f%*s %f %*s"] + ac_cv_swap_format=["%*s %*s %*s %lu%*s %lu %*s"] ac_cv_swap_conv=1 AC_MSG_RESULT([using AIX lsps]) fi diff --git a/plugins/check_swap.c b/plugins/check_swap.c index 05f19ad4..cd965e31 100644 --- a/plugins/check_swap.c +++ b/plugins/check_swap.c @@ -178,7 +178,7 @@ main (int argc, char **argv) # ifdef _AIX if (!allswaps) { xasprintf(&swap_command, "%s", "/usr/sbin/lsps -s"); - xasprintf(&swap_format, "%s", "%f%*s %f"); + xasprintf(&swap_format, "%s", "%lu%*s %lu"); conv_factor = 1; } # endif @@ -205,9 +205,9 @@ main (int argc, char **argv) temp_buffer = strtok (input_buffer, " \n"); while (temp_buffer) { if (strstr (temp_buffer, "blocks")) - sprintf (str, "%s %s", str, "%f"); + sprintf (str, "%s %s", str, "%lu"); else if (strstr (temp_buffer, "dskfree")) - sprintf (str, "%s %s", str, "%f"); + sprintf (str, "%s %s", str, "%lu"); else sprintf (str, "%s %s", str, "%*s"); temp_buffer = strtok (NULL, " \n"); -- cgit v1.2.3-74-g34f1