Changeset 1941

Show
Ignore:
Timestamp:
08/17/2007 11:35:26 PM (13 months ago)
Author:
jan
Message:

fixed counter overrun in ?auto in mod_status (#909)

Location:
branches/lighttpd-1.4.x
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • branches/lighttpd-1.4.x/NEWS

    r1940 r1941  
    1616  * fixed invalid "304 Not Modified" on broken timestamps 
    1717  * fixed endless loop on shrinked files with sendfile() on BSD (#1289) 
     18  * fixed counter overrun in ?auto in mod_status (#909) 
    1819  * removed config-check if passwd files exist (#1188) 
    1920 
  • branches/lighttpd-1.4.x/src/mod_status.c

    r1864 r1941  
    560560        double avg; 
    561561        time_t ts; 
     562        char buf[32]; 
    562563 
    563564        b = chunkqueue_get_append_buffer(con->write_queue); 
     
    566567        BUFFER_APPEND_STRING_CONST(b, "Total Accesses: "); 
    567568        avg = p->abs_requests; 
    568         buffer_append_long(b, avg); 
     569        snprintf(buf, sizeof(buf) - 1, "%.0f", avg); 
     570        buffer_append_string(b, buf); 
    569571        BUFFER_APPEND_STRING_CONST(b, "\n"); 
    570572 
     
    572574        BUFFER_APPEND_STRING_CONST(b, "Total kBytes: "); 
    573575        avg = p->abs_traffic_out / 1024; 
    574         buffer_append_long(b, avg); 
     576        snprintf(buf, sizeof(buf) - 1, "%.0f", avg); 
     577        buffer_append_string(b, buf); 
    575578        BUFFER_APPEND_STRING_CONST(b, "\n"); 
    576579