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
1aa6c288
Commit
1aa6c288
authored
Jan 28, 2016
by
Geoff Simmons
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
change the encoder interface -- encoders always append the null byte,
except when the encoding is the empty string
parent
2d94f811
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
6 additions
and
2 deletions
+6
-2
base64.c
src/base64.c
+1
-0
hex.c
src/hex.c
+1
-0
id.c
src/id.c
+1
-0
vmod_convert.h
src/vmod_convert.h
+3
-2
No files found.
src/base64.c
View file @
1aa6c288
...
...
@@ -182,6 +182,7 @@ base64_encode(const enum encoding enc, char *restrict const buf,
}
assert
(
outlen
>
0
);
*
p
++
=
'\0'
;
return
p
-
buf
;
}
...
...
src/hex.c
View file @
1aa6c288
...
...
@@ -134,6 +134,7 @@ hex_encode(const enum encoding enc, char *restrict const buf,
*
p
++
=
alphabet
[
in
[
i
]
&
0x0f
];
}
*
p
++
=
'\0'
;
return
p
-
buf
;
}
...
...
src/id.c
View file @
1aa6c288
...
...
@@ -48,6 +48,7 @@ id_encode(const enum encoding enc, char *restrict const buf,
return
0
;
memcpy
(
buf
,
in
,
inlen
);
buf
[
inlen
]
=
'\0'
;
return
inlen
;
}
...
...
src/vmod_convert.h
View file @
1aa6c288
...
...
@@ -60,8 +60,9 @@
*
* The regions pointed to by buf and in MUST NOT overlap (this is the
* contract imposed by restrict).
* An encoder SHALL NOT append the terminating null byte (this must
* be done by the caller).
* An encoder SHALL append the terminating null byte if the length of
* the encoding is greater than 0; if the length is 0, the encoder
* SHALL NOT write the null byte.
*
* Returns:
* -1, if there is insufficient space at buf, *including* space for the
...
...
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