tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mt...@apache.org
Subject cvs commit: jakarta-tomcat-connectors/jk/native/common jk_map.c
Date Fri, 18 Mar 2005 15:32:15 GMT
mturk       2005/03/18 07:32:14

  Modified:    jk/native/common jk_map.c
  Log:
  Add empty string checking for trim function.
  
  Revision  Changes    Path
  1.32      +6 -3      jakarta-tomcat-connectors/jk/native/common/jk_map.c
  
  Index: jk_map.c
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native/common/jk_map.c,v
  retrieving revision 1.31
  retrieving revision 1.32
  diff -u -r1.31 -r1.32
  --- jk_map.c	18 Mar 2005 15:22:24 -0000	1.31
  +++ jk_map.c	18 Mar 2005 15:32:14 -0000	1.32
  @@ -482,8 +482,11 @@
   static size_t trim(char *s)
   {
       size_t i;
  -
  -    for (i = strlen(s) - 1; (i >= 0) &&
  +    
  +    /* check for empry strings */
  +    if (!(i = strlen(s)))
  +        return 0;
  +    for (i = i - 1; (i >= 0) &&
            isspace((int)((unsigned char)s[i])); i--);
   
       s[i + 1] = '\0';
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org


Mime
View raw message