]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
debug/bool: Switch use_color to a bool
authorJeff Lucovsky <jlucovsky@oisf.net>
Thu, 27 Jul 2023 16:54:27 +0000 (12:54 -0400)
committerVictor Julien <victor@inliniac.net>
Fri, 17 Nov 2023 21:24:13 +0000 (22:24 +0100)
src/util-debug.c
src/util-debug.h

index 80509ae7ca0b2c11058a366b794134af68199576..c62a0104dda3fadf12f18ed02f5088a8a9bd53f5 100644 (file)
@@ -341,7 +341,7 @@ static const char *SCTransformModule(const char *module_name, int *dn_len)
  *
  * \retval 0 on success; else a negative value on error
  */
-static SCError SCLogMessageGetBuffer(SCTime_t tval, int color, SCLogOPType type, char *buffer,
+static SCError SCLogMessageGetBuffer(SCTime_t tval, bool color, SCLogOPType type, char *buffer,
         size_t buffer_size, const char *log_format, const SCLogLevel log_level, const char *file,
         const unsigned int line, const char *function, const char *module, const char *message)
 {
@@ -952,7 +952,7 @@ static inline SCLogOPIfaceCtx *SCLogInitConsoleOPIface(const char *log_format,
 
 #ifndef OS_WIN32
     if (isatty(fileno(stdout)) && isatty(fileno(stderr))) {
-        iface_ctx->use_color = TRUE;
+        iface_ctx->use_color = true;
     }
 #endif
 
index 2a0864cdd83a0e5bf7fcfc8ad7cb9c0df945cc40..296cf896519c068220d033222ff63a826fbc6d65 100644 (file)
@@ -115,7 +115,7 @@ typedef struct SCLogOPBuffer_ {
 typedef struct SCLogOPIfaceCtx_ {
     SCLogOPIface iface;
 
-    int16_t use_color;
+    bool use_color;
     SCLogOPType type;
 
     /* the output file to be used if the interface is SC_LOG_IFACE_FILE */