]> git.ipfire.org Git - thirdparty/libvirt.git/commit
sockettest: testMaskNetwork: use g_auto
authorJán Tomko <jtomko@redhat.com>
Thu, 19 Nov 2020 15:57:52 +0000 (16:57 +0100)
committerJán Tomko <jtomko@redhat.com>
Thu, 19 Nov 2020 16:25:44 +0000 (17:25 +0100)
commit2bc827a949f3a9b6277fd3c0897e411beb3c22a2
tree57996b6ba6c94c1dedca858436bf320ea652e99e
parent8ce8d591b036391c5907286099920a4735b004de
sockettest: testMaskNetwork: use g_auto

This has the added benefit of 'gotnet' only being freed after
it was possibly used in the output string.

../src/internal.h:519:27: error: ‘%s’ directive argument is null [-Werror=format-overflow=]
  519 | # define fprintf(fh, ...) g_fprintf(fh, __VA_ARGS__)
      |                           ^~~~~~~~~~~~~~~~~~~~~~~~~~
../tests/sockettest.c:194:9: note: in expansion of macro ‘fprintf’
  194 |         fprintf(stderr, "Expected %s, got %s\n", networkstr, gotnet);
      |         ^~~~~~~

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reported-by: Jaroslav Suchanek <jsuchane@redhat.com>
Fixes: ba08c5932e556aa4f5101357127a6224c40e5ebe
Reviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com>
tests/sockettest.c