httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From traw...@apache.org
Subject cvs commit: httpd-2.0/modules/mappers mod_negotiation.c
Date Mon, 18 Nov 2002 14:13:53 GMT
trawick     2002/11/18 06:13:53

  Modified:    modules/mappers mod_negotiation.c
  Log:
  use memcpy() instead of strncpy() since strncpy() is more expensive but
  none of its extra function is needed
  
  Revision  Changes    Path
  1.108     +5 -1      httpd-2.0/modules/mappers/mod_negotiation.c
  
  Index: mod_negotiation.c
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/modules/mappers/mod_negotiation.c,v
  retrieving revision 1.107
  retrieving revision 1.108
  diff -u -r1.107 -r1.108
  --- mod_negotiation.c	9 Aug 2002 19:21:57 -0000	1.107
  +++ mod_negotiation.c	18 Nov 2002 14:13:53 -0000	1.108
  @@ -809,7 +809,11 @@
           return -1;
       }
   
  -    strncpy(buffer + *len, tag, taglen);
  +    /* put a copy of the tag *after* the data read from the file
  +     * so that strstr() will find something with no reliance on
  +     * terminating '\0'
  +     */
  +    memcpy(buffer + *len, tag, taglen);
       endbody = strstr(buffer, tag);
       if (endbody == buffer + *len) {
           return -1;
  
  
  

Mime
View raw message