summaryrefslogtreecommitdiffstats
path: root/lib/libc/gen/vis.c
diff options
context:
space:
mode:
authordan <dan@FreeBSD.org>2000-07-01 17:49:34 +0000
committerdan <dan@FreeBSD.org>2000-07-01 17:49:34 +0000
commit1f43692f55a59ca64a40d1fdb79589d7bb091952 (patch)
tree0a34c112735dc49e495249ca6ea86fa6ab8791a8 /lib/libc/gen/vis.c
parent4b9cb06856c3e02a9d1f5b363f3240c2b55fb2a3 (diff)
downloadFreeBSD-src-1f43692f55a59ca64a40d1fdb79589d7bb091952.zip
FreeBSD-src-1f43692f55a59ca64a40d1fdb79589d7bb091952.tar.gz
Style fixes.
Diffstat (limited to 'lib/libc/gen/vis.c')
-rw-r--r--lib/libc/gen/vis.c23
1 files changed, 12 insertions, 11 deletions
diff --git a/lib/libc/gen/vis.c b/lib/libc/gen/vis.c
index cc3501d..7f10aa5 100644
--- a/lib/libc/gen/vis.c
+++ b/lib/libc/gen/vis.c
@@ -56,17 +56,18 @@ vis(dst, c, flag, nextc)
c = (unsigned char)c;
if (flag & VIS_HTTPSTYLE) {
- if (!((c >= '0' && c <= '9') || (c >= 'A' && c <= 'Z')
- || (c >= 'a' && c <= 'z') || c == '$' || c == '-'
- || c == '_' || c == '\'' || c == '+' || c == '!' ||
- c == '(' || c == ')' || c == ',' || c == '"' ||
- c == ';' || c == '/' || c == '?' || c == ':' ||
- c == '@' || c == '&' || c == '=' || c == '+')) {
- *dst++ = '%';
- snprintf(dst, 4, (c < 16 ? "0%X" : "%X"), c);
- dst += 2;
- goto done;
- }
+ /* Described in RFC 1808 */
+ if (!(isalnum(c) /* alpha-numeric */
+ /* safe */
+ || c == '$' || c == '-' || c == '_' || c == '.' || c == '+'
+ /* extra */
+ || c == '!' || c == '*' || c == '\'' || c == '('
+ || c == ')' || c == ',')) {
+ *dst++ = '%';
+ snprintf(dst, 4, (c < 16 ? "0%X" : "%X"), c);
+ dst += 2;
+ goto done;
+ }
}
if (isgraph(c) ||
OpenPOWER on IntegriCloud