summaryrefslogtreecommitdiffstats
path: root/plugins/utils.c
diff options
context:
space:
mode:
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 011f715..f7f8952 100644
--- a/plugins/utils.c
+++ b/plugins/utils.c
@@ -246,19 +246,19 @@ is_intnonneg (char *number)
246 * On success the number will be written to the _target_ address, if _target_ is not set 246 * On success the number will be written to the _target_ address, if _target_ is not set
247 * to NULL. 247 * to NULL.
248 */ 248 */
249bool is_int64(char *number, int64_t *target) { 249int is_int64(char *number, int64_t *target) {
250 errno = 0; 250 errno = 0;
251 uint64_t tmp = strtoll(number, NULL, 10); 251 uint64_t tmp = strtoll(number, NULL, 10);
252 if (errno != 0) { 252 if (errno != 0) {
253 return false; 253 return 0;
254 } 254 }
255 if (tmp < INT64_MIN || tmp > INT64_MAX) { 255 if (tmp < INT64_MIN || tmp > INT64_MAX) {
256 return false; 256 return 0;
257 } 257 }
258 if (target != NULL) { 258 if (target != NULL) {
259 *target = tmp; 259 *target = tmp;
260 } 260 }
261 return true; 261 return 1;
262} 262}
263 263
264/* 264/*
@@ -266,19 +266,19 @@ bool is_int64(char *number, int64_t *target) {
266 * On success the number will be written to the _target_ address, if _target_ is not set 266 * On success the number will be written to the _target_ address, if _target_ is not set
267 * to NULL. 267 * to NULL.
268 */ 268 */
269bool is_uint64(char *number, uint64_t *target) { 269int is_uint64(char *number, uint64_t *target) {
270 errno = 0; 270 errno = 0;
271 uint64_t tmp = strtoll(number, NULL, 10); 271 uint64_t tmp = strtoll(number, NULL, 10);
272 if (errno != 0) { 272 if (errno != 0) {
273 return false; 273 return 0;
274 } 274 }
275 if (tmp < 0 || tmp > UINT64_MAX) { 275 if (tmp < 0 || tmp > UINT64_MAX) {
276 return false; 276 return 0;
277 } 277 }
278 if (target != NULL) { 278 if (target != NULL) {
279 *target = tmp; 279 *target = tmp;
280 } 280 }
281 return true; 281 return 1;
282} 282}
283 283
284int 284int