Fix bug #44 - [Request] IP log in the memory
This commit is contained in:
@@ -361,3 +361,10 @@ int split_string(const char* string, const char* split, struct linked_list* list
|
||||
return n;
|
||||
}
|
||||
|
||||
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);
|
||||
return ts;
|
||||
}
|
||||
|
||||
@@ -22,6 +22,8 @@
|
||||
|
||||
typedef int (*file_line_handler_t)(char* line, int line_number, void* data);
|
||||
|
||||
extern const char* get_timestamp(time_t time);
|
||||
|
||||
extern int is_num(char c);
|
||||
extern int is_space(char c);
|
||||
extern int is_white_space(char c);
|
||||
|
||||
Reference in New Issue
Block a user