rwrap: fix warning where %s is always passed a NULL pointer in rwrap_create_fake_uri_rr()
authorStefan Metzmacher <metze@samba.org>
Thu, 19 Mar 2020 08:54:48 +0000 (09:54 +0100)
committerAndreas Schneider <asn@samba.org>
Thu, 19 Mar 2020 16:12:41 +0000 (17:12 +0100)
commitc42bd7816325c460f07036101aab282049cd72df
tree43bc101e6410e18e0504ba11056d6b586c20d3ee
parentc8d013f3f484dc54748ca7132358ab8814d15c90
rwrap: fix warning where %s is always passed a NULL pointer in rwrap_create_fake_uri_rr()

This happens in Samba's gitlab pipeline on Fedora 30/31:

 [3203/4410] Compiling third_party/resolv_wrapper/resolv_wrapper.c
==> /builds/samba-team/devel/samba/samba-o3.stderr <==
../../third_party/resolv_wrapper/resolv_wrapper.c: In function ‘rwrap_create_fake_uri_rr’:
../../third_party/resolv_wrapper/resolv_wrapper.c:104:33: error: ‘%s’ directive argument is null [-Werror=format-overflow=]
  104 | # define RWRAP_LOG(dbglvl, ...) rwrap_log((dbglvl), __func__, __VA_ARGS__)
      |                                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../third_party/resolv_wrapper/resolv_wrapper.c:340:3: note: in expansion of macro ‘RWRAP_LOG’
  340 |   RWRAP_LOG(RWRAP_LOG_ERROR,
      |   ^~~~~~~~~
../../third_party/resolv_wrapper/resolv_wrapper.c:341:28: note: format string is defined here
  341 |      "Malformed URI entry [%s]\n", value);
      |                            ^~
cc1: all warnings being treated as errors

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
src/resolv_wrapper.c