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
22342600
Commit
22342600
authored
Apr 11, 2016
by
Geoff Simmons
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
simplify id_decode()
parent
cf73bad4
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
9 deletions
+11
-9
id.c
src/id.c
+11
-9
No files found.
src/id.c
View file @
22342600
...
...
@@ -28,6 +28,7 @@
#include <string.h>
#include <errno.h>
#include <stdint.h>
#include "vmod_blobcode.h"
...
...
@@ -69,23 +70,24 @@ id_decode(const enum encoding enc,
ssize_t
n
,
const
char
*
restrict
const
p
,
va_list
ap
)
{
char
*
dest
=
buf
;
size_t
len
,
outlen
=
0
;
size_t
outlen
=
0
,
c
=
SIZE_MAX
;
(
void
)
enc
;
AN
(
buf
);
for
(
const
char
*
s
=
p
;
s
!=
vrt_magic_string_end
;
if
(
n
>=
0
)
c
=
n
;
for
(
const
char
*
s
=
p
;
c
>
0
&&
s
!=
vrt_magic_string_end
;
s
=
va_arg
(
ap
,
const
char
*
))
{
size_t
len
;
if
(
s
==
NULL
||
*
s
==
'\0'
)
continue
;
len
=
strlen
(
s
);
if
(
n
>=
0
)
{
if
(
n
==
0
)
break
;
if
(
len
>
n
)
len
=
n
;
n
-=
len
;
}
if
(
len
>
c
)
len
=
c
;
c
-=
len
;
if
((
outlen
+=
len
)
>
buflen
)
{
errno
=
ENOMEM
;
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