HomeClusterLabs Projects

Low: all: use default value when a long long integer can't be parsed

Description

Low: all: use default value when a long long integer can't be parsed

The crm_parse_ll() function uses the supplied default text when the text to be
parsed is NULL, but not when the text to be parsed is invalid (it uses -1
a.k.a. PCMK__PARSE_INT_DEFAULT).

This replaces internal calls of crm_parse_ll() with a new pcmk__scan_ll()
function that returns a standard Pacemaker return code, takes a long long
default value rather than default text, and uses the default value when the
text to be parsed is invalid.

Also, callers that cast the result to something smaller than long long now do
proper bounds checking first.

Details

Provenance
kgaillotAuthored on Mar 25 2021, 5:55 PM
Parents
rP25eb1416f121: Merge pull request #2336 from clumens/crm_simulate-misc
Branches
Unknown
Tags
Unknown

Event Timeline