[icecast] and and in stats.log

Jose Celestino japc at co.sapo.pt
Wed Oct 23 09:07:46 PDT 2002


minutes gets repeated at nice_time_minutes.

patch attached


-- 
Jose Celestino <japc at co.sapo.pt> SysAdmin::SAPO.pt http://www.sapo.pt
-----------------------------------------------------
"Lately, the only thing keeping me from becoming a serial killer is my distaste
for manual labor."        -- Dilbert


-------------- next part --------------
*** icecast-1.3.12/src/ice_string.c	2002-04-10 23:26:42.000000000 +0100
--- icecast-1.3.12.japc/src/ice_string.c	2002-10-23 16:59:10.000000000 +0100
***************
*** 475,495 ****
  	remains = remains % 60;
  
  	if (days > 0)
! 		snprintf(buf, BUFSIZE, "%lu days, %lu hours, %lu minutes", days, hours, remains);
! 	else if (hours > 0)
! 		snprintf(buf, BUFSIZE, "%lu hours, %lu minutes", hours, remains);
  	else
  	{
  		snprintf(buf, BUFSIZE, "%lu minutes", remains);
  		return buf;
  	}
  
- 	if (remains > 0)
- 	{
- 		snprintf(buf2, BUFSIZE, " and %lu minutes", remains);
- 		strncat(buf, buf2, BUFSIZE - strlen(buf2));
- 	}
- 
  	return buf;
  }
  
--- 475,489 ----
  	remains = remains % 60;
  
  	if (days > 0)
! 		snprintf(buf, BUFSIZE, "%lu days, %lu hours and %lu minutes", days, hours, remains);
! 	else if (hours > 0 && remains > 0)
! 		snprintf(buf, BUFSIZE, "%lu hours and %lu minutes", hours, remains);
  	else
  	{
  		snprintf(buf, BUFSIZE, "%lu minutes", remains);
  		return buf;
  	}
  
  	return buf;
  }
  



More information about the Icecast mailing list