mirror of
https://git.proxmox.com/git/mirror_corosync
synced 2025-08-15 18:36:31 +00:00

Function atoi is not safe since miss validation; Function strtol is better but need to consider empty string and overflows Function util_strtonum is a safer wrapper of strtoll Use util_strtonum to check nodeid option and strict checking condition. Signed-off-by: liangxin1300 <XLiang@suse.com> Reviewed-by: Jan Friesse <jfriesse@redhat.com>
16 lines
316 B
C
16 lines
316 B
C
#ifndef COROSYNC_TOOLS_UTIL_H_DEFINED
|
|
#define COROSYNC_TOOLS_UTIL_H_DEFINED
|
|
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
|
|
extern int util_strtonum(const char *str, long long int min_val,
|
|
long long int max_val, long long int *res);
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|
|
|
|
#endif /* COROSYNC_TOOLS_UTIL_H_DEFINED */
|