httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rob Hartill <r...@imdb.com>
Subject Re: Fix for mod_status.c (apache-1.1b2)
Date Fri, 03 May 1996 14:44:32 GMT

thanks. this is a known bug (it's on the known bugs list).

Thanks for the patch, it'll be considered.

regards,
rob

>mod_status.c makes use of sprintf returning the number of characters printed to
>a string buffer.  Unfortunatelly this fails on old BSD systems (like SunOS 4.1.x)
>where sprintf returns a character pointer to the original string buffer.
>
>I suggest to include the following fix for the 1.1 release version:
>
>*** mod_status.c~	Wed Apr 17 03:00:22 1996
>--- mod_status.c	Fri May  3 14:39:03 1996
>***************
>*** 115,128 ****
>      days=tsecs/24;
>      s=buf;
>      *s='\0';
>!     if(days)
>!       s+=sprintf(s," %ld day%s",days,days==1?"":"s");
>!     if(hrs)
>!       s+=sprintf(s," %ld hour%s",hrs,hrs==1?"":"s");
>!     if(mins)
>!       s+=sprintf(s," %ld minute%s",mins,mins==1?"":"s");
>!     if(secs)
>!       s+=sprintf(s," %ld second%s",secs,secs==1?"":"s");
>      rputs(buf,r);
>  }
>  
>--- 115,136 ----
>      days=tsecs/24;
>      s=buf;
>      *s='\0';
>!     if(days) {
>! 	sprintf(s," %ld day%s",days,days==1?"":"s");
>! 	s += strlen(s);
>!     }
>!     if(hrs) {
>! 	sprintf(s," %ld hour%s",hrs,hrs==1?"":"s");
>! 	s += strlen(s);
>!     }
>!     if(mins) {
>! 	sprintf(s," %ld minute%s",mins,mins==1?"":"s");
>! 	s += strlen(s);
>!     }
>!     if(secs) {
>! 	sprintf(s," %ld second%s",secs,secs==1?"":"s");
>! 	s += strlen(s);
>!     }
>      rputs(buf,r);
>  }
>  


-- 
Rob Hartill (robh@imdb.com)
The Internet Movie Database (IMDb)  http://www.imdb.com/
           ...more movie info than you can poke a stick at.

Mime
View raw message