Fix bug #167 - Build errors on OpenBSD.
- Don't link with -ldl, as it is not needed in most cases - Don't compile plugins if USE_PLUGINS=NO - Fix warning about missing newline at end of getopt.h - Removed the O_NOATIME open() flag from the logging plugin. - Removed the O_LARGEFILE open() flag. _FILE_OFFSET_BITS is 64. - Use fsync() if fdatasync() is not available for log file writing. - Replaced some sprintf() with snprintf() due to compiler warnings (though, they were length limited otherwise). - Replaced two occurences of strcpy() with memcpy().
This commit is contained in:
@@ -399,7 +399,7 @@ const char* get_timestamp(time_t now)
|
||||
{
|
||||
static char ts[32] = {0, };
|
||||
struct tm* t = localtime(&now);
|
||||
sprintf(ts, "[%02d:%02d]", t->tm_hour, t->tm_min);
|
||||
snprintf(ts, sizeof(ts), "[%02d:%02d]", t->tm_hour, t->tm_min);
|
||||
return ts;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user