HomeClusterLabs Projects

Refactor: libcrmcommon: Error-check snprintf() in pcmk_readable_score()

Description

Refactor: libcrmcommon: Error-check snprintf() in pcmk_readable_score()

Also avoid unnecessary strcpy() calls by returning the desired string
without copying it to a buffer.

The xstr() and str() macros are unnecessary if we just hard-code
sizeof("-1000000"). I try to avoid using magic numbers but I don't have
strong feelings.

Ref T974

Signed-off-by: Reid Wahl <nrwahl@protonmail.com>

Details

Provenance
nrwahl2Authored on Fri, Jun 20, 5:45 PM
Parents
rP249a3dab5dc8: Refactor: libcrmcommon: Avoid snprintf() in pcmk__pid_active()
Branches
Unknown
Tags
Unknown
Tasks
T974: Error-check snprintf() calls