aboutsummaryrefslogtreecommitdiff
path: root/plugins/utils.c
diff options
context:
space:
mode:
authorGravatar RincewindsHat <12514511+RincewindsHat@users.noreply.github.com> 2021-10-02 23:37:12 +0200
committerGravatar RincewindsHat <12514511+RincewindsHat@users.noreply.github.com> 2021-10-02 23:37:12 +0200
commit46c5327e348540ab04dc37d42f6d1c5408179fa6 (patch)
tree06daa9142183c0f6c6624bebcffd7d11de1ab976 /plugins/utils.c
parentd2f2da175eda5a06291a974d971968a1241d7935 (diff)
downloadmonitoring-plugins-46c5327e348540ab04dc37d42f6d1c5408179fa6.tar.gz
Revert to poor man's logic
Diffstat (limited to 'plugins/utils.c')
-rw-r--r--plugins/utils.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/plugins/utils.c b/plugins/utils.c
index 011f715d..f7f8952f 100644
--- a/plugins/utils.c
+++ b/plugins/utils.c
@@ -246,19 +246,19 @@ is_intnonneg (char *number)
* On success the number will be written to the _target_ address, if _target_ is not set
* to NULL.
*/
-bool is_int64(char *number, int64_t *target) {
+int is_int64(char *number, int64_t *target) {
errno = 0;
uint64_t tmp = strtoll(number, NULL, 10);
if (errno != 0) {
- return false;
+ return 0;
}
if (tmp < INT64_MIN || tmp > INT64_MAX) {
- return false;
+ return 0;
}
if (target != NULL) {
*target = tmp;
}
- return true;
+ return 1;
}
/*
@@ -266,19 +266,19 @@ bool is_int64(char *number, int64_t *target) {
* On success the number will be written to the _target_ address, if _target_ is not set
* to NULL.
*/
-bool is_uint64(char *number, uint64_t *target) {
+int is_uint64(char *number, uint64_t *target) {
errno = 0;
uint64_t tmp = strtoll(number, NULL, 10);
if (errno != 0) {
- return false;
+ return 0;
}
if (tmp < 0 || tmp > UINT64_MAX) {
- return false;
+ return 0;
}
if (target != NULL) {
*target = tmp;
}
- return true;
+ return 1;
}
int