Commit 39c45210 authored by Dom Rushbrook's avatar Dom Rushbrook
Browse files

sprintf(out,"%2ldd%2ldh",t/86400, (t%86400)/3600); overflowed static char...

sprintf(out,"%2ldd%2ldh",t/86400, (t%86400)/3600); overflowed static char out[7] when t > 100days as %2ld only states a minimum width.
Changed out to allow for the longest possible string that sprintf can make from a 64bit unsigned long '106751991167300d15h' (20 chars including the null)
Fixes #22
parent f77c5ea7
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -30,7 +30,7 @@ extern struct user * const user;

char *itime(unsigned long t)
{
	static char out[7];
	static char out[20];

	if (t>=3600*48) sprintf(out,"%2ldd%2ldh",t/86400, (t%86400)/3600);
	else