case LOGMODE_FILE:
if(!now.tv_sec)
gettimeofday(&now, NULL);
- strftime(timestr, sizeof timestr, "%Y-%m-%d %H:%M:%S", localtime(&now.tv_sec));
+ time_t now_sec = now.tv_sec;
+ strftime(timestr, sizeof timestr, "%Y-%m-%d %H:%M:%S", localtime(&now_sec));
fprintf(logfile, "%s %s[%ld]: %s\n", timestr, logident, (long)logpid, message);
fflush(logfile);
break;
int offset = (type & PKT_MAC) ? 0 : 14;
if(type & PKT_COMPRESSED) {
- len = uncompress_packet(inpkt.data + offset, (const uint8_t *)data, len, from->incompression);
- if(len < 0) {
+ length_t ulen = uncompress_packet(inpkt.data + offset, (const uint8_t *)data, len, from->incompression);
+ if(ulen < 0) {
return false;
} else {
- inpkt.len = len + offset;
+ inpkt.len = ulen + offset;
}
if(inpkt.len > MAXSIZE)
abort();