Relocate a variable declaration to the function where it is used
authorFabian Keil <fk@fabiankeil.de>
Fri, 25 Sep 2020 19:52:02 +0000 (21:52 +0200)
committerFabian Keil <fk@fabiankeil.de>
Sat, 26 Sep 2020 09:32:39 +0000 (11:32 +0200)
pcrs.c

diff --git a/pcrs.c b/pcrs.c
index 582f056..4a9e318 100644 (file)
--- a/pcrs.c
+++ b/pcrs.c
@@ -1106,7 +1106,6 @@ char *pcrs_execute_single_command(const char *subject, const char *pcrs_command,
 }
 
 
 }
 
 
-static const char warning[] = "... [too long, truncated]";
 /*********************************************************************
  *
  * Function    :  pcrs_compile_dynamic_command
 /*********************************************************************
  *
  * Function    :  pcrs_compile_dynamic_command
@@ -1173,6 +1172,7 @@ pcrs_job *pcrs_compile_dynamic_command(char *pcrs_command, const struct pcrs_var
           * with a truncation message and close the pattern
           * properly.
           */
           * with a truncation message and close the pattern
           * properly.
           */
+         static const char warning[] = "... [too long, truncated]";
          const size_t trailer_size = sizeof(warning) + 3; /* 3 for d + "gT" */
          char *trailer_start = buf + sizeof(buf) - trailer_size;
 
          const size_t trailer_size = sizeof(warning) + 3; /* 3 for d + "gT" */
          char *trailer_start = buf + sizeof(buf) - trailer_size;