httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mkg...@mit.edu
Subject Re: WWW Form Bug Report: "mod_status.c doesn't compile" on SunOS 4.x
Date Tue, 23 Apr 1996 14:44:05 GMT
> thanks. A few people have pointed this out now.
> 
> Hopefully it'll be added to a "known bugs" page on the Apache site.
> >mod_status.c: In function `show_time':
> >mod_status.c:119: invalid operands to binary +
> >mod_status.c:121: invalid operands to binary +
> >mod_status.c:123: invalid operands to binary +
> >mod_status.c:125: invalid operands to binary +
> >make: *** [mod_status.o] Error 1

We're using mod_status.c on www.mit.edu (SunOS) with the following
patch.  Since it has been pointed out that sprintf isn't guaranteed to
give an int back (though it usually does) the #ifdef might not be
appropriate and we may want to do this this way for all platforms.

						...Mk

*** mod_status.c.orig   Tue Apr 23 14:40:58 1996
--- mod_status.c        Tue Apr 23 14:41:22 1996
***************
*** 115,120 ****
--- 115,142 ----
      days=tsecs/24;
      s=buf;
      *s='\0';
+ #ifdef SUNOS4
+     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);
+     }
+ #else
      if(days)
        s+=sprintf(s," %ld day%s",days,days==1?"":"s");
      if(hrs)
***************
*** 123,128 ****
--- 145,151 ----
        s+=sprintf(s," %ld minute%s",mins,mins==1?"":"s");
      if(secs)
        s+=sprintf(s," %ld second%s",secs,secs==1?"":"s");
+ #endif
      rputs(buf,r);
  }
  

Mime
View raw message