diff options
Diffstat (limited to 'src/log.c')
-rw-r--r-- | src/log.c | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -31,7 +31,7 @@ int sc_push_log (unsigned char t, struct sc_cache * c, const char * ca, char * f return -2; if (pthread_rwlock_wrlock(lock)) return -3; - if (c->logentries_sizeof - c->logentries_length != 0) + if (c->logentries_sizeof <= c->logentries_length) SC_BIGGER_ARRAY(c->logentries, sc_logentry); c->logentries_length++; size_t strlenm = strlen(m); @@ -53,6 +53,7 @@ int sc_push_log (unsigned char t, struct sc_cache * c, const char * ca, char * f SC_PLL->line = l; SC_PLL->function = ca; SC_PLL->time = time(NULL); + SC_PLL->type = t; fprintf(stderr, "[sear.c] %s %s()@%s:%lu: %s\n", sc_log_str(t), ca, f, l, SC_PLL->message); /* in posix, this is thread safe */ if (lock && pthread_rwlock_unlock(lock)) return -4; |