HomeClusterLabs Projects

tools: use util_strtonum for options checking

Description

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>

Details

Provenance
liangxin1300 <XLiang@suse.com>Authored on Aug 7 2020, 12:50 PM
jfriesseCommitted on Aug 12 2020, 10:56 AM
Parents
rCe741f6a612f4: cfgtool: enhancement -a option
Branches
Unknown
Tags
Unknown

Event Timeline