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
388ef3dd
Commit
388ef3dd
authored
Apr 08, 2016
by
Geoff Simmons
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
define a constant used by both url.c and hex.c
parent
92f12dfe
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
8 deletions
+10
-8
hex.c
src/hex.c
+6
-6
hex.h
src/hex.h
+2
-0
url.c
src/url.c
+2
-2
No files found.
src/hex.c
View file @
388ef3dd
...
...
@@ -46,12 +46,12 @@ const char hex_alphabet[][16] = {
* into 55 bytes (cacheline friendly).
*/
const
uint8_t
nibble
[]
=
{
0
,
1
,
2
,
3
,
4
,
5
,
6
,
7
,
8
,
9
,
0xff
,
0xff
,
0xff
,
0xff
,
0xff
,
0xff
,
0xff
,
10
,
11
,
12
,
13
,
14
,
15
,
0xff
,
0xff
,
0xff
,
0xff
,
0xff
,
0xff
,
0xff
,
0xff
,
0xff
,
0xff
,
0xff
,
0xff
,
0xff
,
0xff
,
0xff
,
0xff
,
0xff
,
0xff
,
0xff
,
0xff
,
0xff
,
0xff
,
0xff
,
0xff
,
0xff
,
0xff
,
10
,
11
,
12
,
13
,
14
,
15
0
,
1
,
2
,
3
,
4
,
5
,
6
,
7
,
8
,
9
,
ILL
,
ILL
,
ILL
,
ILL
,
ILL
,
ILL
,
ILL
,
10
,
11
,
12
,
13
,
14
,
15
,
ILL
,
ILL
,
ILL
,
ILL
,
ILL
,
ILL
,
ILL
,
ILL
,
ILL
,
ILL
,
ILL
,
ILL
,
ILL
,
ILL
,
ILL
,
ILL
,
ILL
,
ILL
,
ILL
,
ILL
,
ILL
,
ILL
,
ILL
,
ILL
,
ILL
,
ILL
,
10
,
11
,
12
,
13
,
14
,
15
};
size_t
...
...
src/hex.h
View file @
388ef3dd
...
...
@@ -28,6 +28,8 @@
#include <stdint.h>
#define ILL (0xff)
/* These are defined in hex.c */
extern
const
char
hex_alphabet
[][
16
];
...
...
src/url.c
View file @
388ef3dd
...
...
@@ -148,7 +148,7 @@ url_decode(const enum encoding dec, char *restrict const buf,
break
;
case
PERCENT
:
if
(
isoutofrange
(
*
s
)
||
(
nib
=
nibble
[
*
s
-
'0'
])
==
0xff
)
{
||
(
nib
=
nibble
[
*
s
-
'0'
])
==
ILL
)
{
errno
=
EINVAL
;
return
-
1
;
}
...
...
@@ -160,7 +160,7 @@ url_decode(const enum encoding dec, char *restrict const buf,
return
-
1
;
}
if
(
isoutofrange
(
*
s
)
||
(
nib2
=
nibble
[
*
s
-
'0'
])
==
0xff
)
{
||
(
nib2
=
nibble
[
*
s
-
'0'
])
==
ILL
)
{
errno
=
EINVAL
;
return
-
1
;
}
...
...
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