thresholds: fix unittest compile warning

In file included from decode.h:33,
                 from host.h:27,
                 from util-threshold-config.c:34:
util-threshold-config.c: In function 'SCThresholdConfInitContext':
util-debug.h:260:5: warning: '%s' directive argument is null [-Wformat-overflow=]
  260 |     SCLogErr(SC_LOG_WARNING, __FILE__, __FUNCTION__, __LINE__, _sc_module, __VA_ARGS__)
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
util-threshold-config.c:190:9: note: in expansion of macro 'SCLogWarning'
  190 |         SCLogWarning("Error loading threshold configuration from %s", filename);
      |         ^~~~~~~~~~~~
util-threshold-config.c:190:66: note: format string is defined here
  190 |         SCLogWarning("Error loading threshold configuration from %s", filename);
      |                                                                  ^~

(cherry picked from commit 3a0f4dde07)
pull/14370/head
Victor Julien 8 months ago
parent 3f88e5c64c
commit 26d576d8fd

@ -173,6 +173,7 @@ int SCThresholdConfInitContext(DetectEngineCtx *de_ctx)
#ifndef UNITTESTS
FILE *fd = NULL;
#else
filename = "<ut>";
FILE *fd = g_ut_threshold_fp;
if (fd == NULL) {
#endif

Loading…
Cancel
Save