aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/util/common_logging.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/util/common_logging.c b/src/util/common_logging.c
index a19821511..9d7b0de1f 100644
--- a/src/util/common_logging.c
+++ b/src/util/common_logging.c
@@ -50,6 +50,12 @@
50#define BULK_TRACK_SIZE 256 50#define BULK_TRACK_SIZE 256
51 51
52/** 52/**
53 * How many characters do we use for matching of
54 * bulk components?
55 */
56#define COMP_TRACK_SIZE 32
57
58/**
53 * How many characters can a date/time string 59 * How many characters can a date/time string
54 * be at most? 60 * be at most?
55 */ 61 */
@@ -99,9 +105,9 @@ static struct GNUNET_TIME_Absolute last_bulk_time;
99static unsigned int last_bulk_repeat; 105static unsigned int last_bulk_repeat;
100 106
101/** 107/**
102 * Component when the last bulk was logged. 108 * Component when the last bulk was logged. Will be 0-terminated.
103 */ 109 */
104static const char *last_bulk_comp; 110static char last_bulk_comp[COMP_TRACK_SIZE+1];
105 111
106/** 112/**
107 * Running component. 113 * Running component.
@@ -379,7 +385,7 @@ mylog (enum GNUNET_ErrorType kind,
379 last_bulk_repeat = 0; 385 last_bulk_repeat = 0;
380 last_bulk_kind = kind; 386 last_bulk_kind = kind;
381 last_bulk_time = GNUNET_TIME_absolute_get (); 387 last_bulk_time = GNUNET_TIME_absolute_get ();
382 last_bulk_comp = comp; 388 strncpy (last_bulk_comp, comp, sizeof (last_bulk_comp));
383 output_message (kind, comp, date, buf); 389 output_message (kind, comp, date, buf);
384 free (buf); 390 free (buf);
385} 391}