@@ -13,6 +13,7 @@
#undef DEBUG_CONTEXT
#define GET_BUFS 5
+#define get_buf_inc() if (++current_get_buf == GET_BUFS) current_get_buf = 0;
/*
* Handy aliases for memory tracking and core dumps
@@ -253,10 +253,10 @@ static bool process_timer(egg_timer_t* timer) {
deleted = 1;
}
- if (timer->name)
+ if (timer->name) {
simple_snprintf(get_buf[current_get_buf], sizeof(get_buf[current_get_buf]), "Execing timer: %s", timer->name);
- if (++current_get_buf == GET_BUFS)
- current_get_buf = 0;
+ get_buf_inc();
+ }
callback(client_data);
return deleted;
@@ -1486,11 +1486,10 @@ bool socket_run() {
if (xx >= 0) { /* Non-error */
if ((idx = findanyidx(xx)) != -1) {
if (likely(dcc[idx].type->activity)) {
- if (buf[0])
+ if (buf[0]) {
strlcpy(get_buf[current_get_buf], buf, sizeof(get_buf[current_get_buf]));
-
/* Traffic stats */
if (dcc[idx].type->name) {