Browse Source

Fix special character escape

tags/1.0
Timo Röhling 12 years ago
parent
commit
5d26960180
1 changed files with 2 additions and 2 deletions
  1. 2
    2
      postsrsd.c

+ 2
- 2
postsrsd.c View File

125
   char *output = buf;
125
   char *output = buf;
126
   if (!input || !output || len == 0) return NULL;
126
   if (!input || !output || len == 0) return NULL;
127
   while (*input && --len) {
127
   while (*input && --len) {
128
-    if (isspace(*input)) {
128
+    if (!isascii(*input) || !isgraph(*input) || *input == '%') {
129
       if (len <= 2) break;
129
       if (len <= 2) break;
130
       *output++ = '%';
130
       *output++ = '%';
131
-      char2hex(*input, output);
131
+      char2hex(*input++, output);
132
       output += 2; len -= 2;
132
       output += 2; len -= 2;
133
     } else {
133
     } else {
134
       *output++ = *input++;
134
       *output++ = *input++;

Loading…
Cancel
Save