]> granicus.if.org Git - apache/commitdiff
Make handling of 0 back compatible.
authorBen Laurie <ben@apache.org>
Sat, 3 Jan 2004 17:29:57 +0000 (17:29 +0000)
committerBen Laurie <ben@apache.org>
Sat, 3 Jan 2004 17:29:57 +0000 (17:29 +0000)
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@102162 13f79535-47bb-0310-9956-ffa450edef68

server/gen_test_char.c

index cfd10040ca2ad524b36b8dcc24084e0eb97d8877..d34db3beaf3852c2a9aeebe201b405f49f664da6 100644 (file)
@@ -115,11 +115,11 @@ int main(int argc, char *argv[])
          *
          * Rem please keep in-sync with apr's list in win32/filesys.c
          */
-        if (strchr("&;`'\"|*?~<>^()[]{}$\\\n\r%", c)) {
+        if (c && strchr("&;`'\"|*?~<>^()[]{}$\\\n\r%", c)) {
             flags |= T_ESCAPE_SHELL_CMD;
         }
 #else
-        if (strchr("&;`'\"|*?~<>^()[]{}$\\\n", c)) {
+        if (c && strchr("&;`'\"|*?~<>^()[]{}$\\\n", c)) {
             flags |= T_ESCAPE_SHELL_CMD;
         }
 #endif
@@ -133,7 +133,7 @@ int main(int argc, char *argv[])
         }
 
         /* these are the "tspecials" from RFC2068 */
-        if (apr_iscntrl(c) || strchr(" \t()<>@,;:\\/[]?={}", c)) {
+        if (c && (apr_iscntrl(c) || strchr(" \t()<>@,;:\\/[]?={}", c))) {
             flags |= T_HTTP_TOKEN_STOP;
         }
 
@@ -142,7 +142,7 @@ int main(int argc, char *argv[])
          * backslashes (because we use backslash for escaping)
          * and 8-bit chars with the high bit set
          */
-        if (!apr_isprint(c) || c == '"' || c == '\\' || apr_iscntrl(c)) {
+        if (c && (!apr_isprint(c) || c == '"' || c == '\\' || apr_iscntrl(c))) {
             flags |= T_ESCAPE_LOGITEM;
         }