On a Tuesday in 2021, Peter Krempa wrote:
15 out of 72 invocations of virStrcpy(Static)
That's almost 21%
ignore the return value as
it's either impossible to fail or in certain cases a truncated copy is
still good enough.Unfortunately virStrcpy doesn't copy anything in
such case as the checks are done first.
Fix this by using g_strlcpy for the implementation and removing
G_GNUC_WARN_UNUSED_RESULT from the function so that callers can decide
when it's okay.
Signed-off-by: Peter Krempa <pkrempa(a)redhat.com>
---
src/util/virstring.c | 12 +++++++-----
src/util/virstring.h | 3 +--
2 files changed, 8 insertions(+), 7 deletions(-)
Reviewed-by: Ján Tomko <jtomko(a)redhat.com>
Jano