apr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From do...@apache.org
Subject cvs commit: apr CHANGES
Date Tue, 19 Jun 2001 20:40:31 GMT
dougm       01/06/19 13:40:30

  Modified:    strings  apr_strings.c
               .        CHANGES
  Log:
  apr_pstrcat() optimizations:
  reuse calculated strlen() length
  use memcpy instead of strcpy
  Submitted by:	dougm
  Reviewed by:	jeff trawick, ryan bloom, bill stoddard
  
  Revision  Changes    Path
  1.14      +4 -3      apr/strings/apr_strings.c
  
  Index: apr_strings.c
  ===================================================================
  RCS file: /home/cvs/apr/strings/apr_strings.c,v
  retrieving revision 1.13
  retrieving revision 1.14
  diff -u -r1.13 -r1.14
  --- apr_strings.c	2001/05/10 18:05:18	1.13
  +++ apr_strings.c	2001/06/19 20:40:22	1.14
  @@ -130,15 +130,16 @@
   
       res = (char *) apr_palloc(a, len + 1);
       cp = res;
  -    *cp = '\0';
  +    *(cp + len) = '\0';
   
       /* Pass two --- copy the argument strings into the result space */
   
       va_start(adummy, a);
   
       while ((argp = va_arg(adummy, char *)) != NULL) {
  -        strcpy(cp, argp);
  -        cp += strlen(argp);
  +        len = strlen(argp);
  +        memcpy(cp, argp, len);
  +        cp += len;
       }
   
       va_end(adummy);
  
  
  
  1.114     +1 -0      apr/CHANGES
  
  Index: CHANGES
  ===================================================================
  RCS file: /home/cvs/apr/CHANGES,v
  retrieving revision 1.113
  retrieving revision 1.114
  diff -u -r1.113 -r1.114
  --- CHANGES	2001/06/13 16:10:15	1.113
  +++ CHANGES	2001/06/19 20:40:28	1.114
  @@ -1,4 +1,5 @@
   Changes with APR b1  
  +  *) apr_pstrcat() optimizations [Doug MacEachern, Jeff Trawick]
   
     *) Make the apr_pool_is_ancestor logic public.  This is required for 
        some new logic that is going into HTTPD.  I have left the join logic
  
  
  

Mime
View raw message