Skip to content

Commit 4c32543

Browse files
committed
Revise maximum length for date time in log. Closes #1777
1 parent 2764772 commit 4c32543

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

src/logger.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -154,13 +154,11 @@ FILE * set_logfile(const char *logfile_name)
154154
*/
155155
static char *str_time(void)
156156
{
157-
//static char buffer[16]; // the month differs depending on the language. ex)LANG=ja_JP.UTF-8
158-
static char buffer[18];
157+
static char buffer[30]; /* Arbitrary length*/
159158
time_t now = 0;
160159

161160
now = time(0);
162-
//strftime(buffer, 16, "%b %d %H:%M:%S", localtime(&now));
163-
strftime(buffer, 18, "%b %d %H:%M:%S", localtime(&now));
161+
strftime(buffer, sizeof(buffer), "%b %d %H:%M:%S", localtime(&now));
164162
return buffer;
165163
}
166164

0 commit comments

Comments
 (0)