]> git.proxmox.com Git - mirror_corosync.git/commit
tools: use util_strtonum for options checking
authorliangxin1300 <XLiang@suse.com>
Fri, 7 Aug 2020 16:50:29 +0000 (00:50 +0800)
committerJan Friesse <jfriesse@redhat.com>
Wed, 12 Aug 2020 14:56:34 +0000 (16:56 +0200)
commitfb5e0fae92417093127335a2114fadde9262315d
tree3fbe4bf55e97ae2595bc95e7045b38e6f4b17eba
parente741f6a612f401b3dcb33594b3dd3799b66eb8c9
tools: use util_strtonum for options checking

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>
tools/Makefile.am
tools/corosync-cfgtool.c
tools/corosync-quorumtool.c
tools/util.c [new file with mode: 0644]
tools/util.h [new file with mode: 0644]