Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
libvmod-blobcode
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
1
Issues
1
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
uplex-varnish
libvmod-blobcode
Commits
92f12dfe
Commit
92f12dfe
authored
Apr 08, 2016
by
Geoff Simmons
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
simplify the check for out of workspace in URL encode
parent
0e0e007c
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
2 deletions
+3
-2
url.c
src/url.c
+3
-2
No files found.
src/url.c
View file @
92f12dfe
...
...
@@ -81,6 +81,7 @@ url_encode(const enum encoding enc, char *restrict const buf,
const
size_t
inlen
)
{
char
*
p
=
buf
;
const
char
*
const
end
=
buf
+
buflen
;
const
char
*
alphabet
=
hex_alphabet
[
0
];
AN
(
buf
);
...
...
@@ -93,12 +94,12 @@ url_encode(const enum encoding enc, char *restrict const buf,
for
(
int
i
=
0
;
i
<
inlen
;
i
++
)
{
if
(
isunreserved
(
in
[
i
]))
{
if
(
p
+
1
-
buf
>
buflen
)
if
(
p
==
end
)
return
-
1
;
*
p
++
=
in
[
i
];
}
else
{
if
(
p
+
3
-
buf
>
buflen
)
if
(
p
+
3
>
end
)
return
-
1
;
*
p
++
=
'%'
;
*
p
++
=
alphabet
[(
in
[
i
]
&
0xf0
)
>>
4
];
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment