Merge pull request #5 from Vlaix/master
Fixed small buffer in get_datetime()
This commit is contained in:
commit
175844da0f
1 changed files with 2 additions and 2 deletions
|
@ -168,13 +168,13 @@ char *
|
|||
get_datetime()
|
||||
{
|
||||
time_t tm;
|
||||
size_t bufsize = 19;
|
||||
size_t bufsize = 64;
|
||||
char *buf = malloc(bufsize);
|
||||
|
||||
/* get time in format */
|
||||
time(&tm);
|
||||
if(!strftime(buf, bufsize, timeformat, localtime(&tm))) {
|
||||
fprintf(stderr, "Strftime failed.\n");
|
||||
fprintf(stderr, "Strftime failed.\n");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue