Fixed small buffer in get_datetime()
The buffer being hardcoded to 19 (the size expected from the default time format), strftime() would fail on any format returning a longer buffer. Changed it from 19 to 64 to accomodate longer formats.
This commit is contained in:
		@@ -143,7 +143,7 @@ char *
 | 
				
			|||||||
get_datetime()
 | 
					get_datetime()
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
    time_t tm;
 | 
					    time_t tm;
 | 
				
			||||||
    size_t bufsize = 19;
 | 
					    size_t bufsize = 64;
 | 
				
			||||||
    char *buf = malloc(bufsize);
 | 
					    char *buf = malloc(bufsize);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    /* get time in format */
 | 
					    /* get time in format */
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user