Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
A
asn1c
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
qwebaby3
asn1c
Commits
81d57419
Commit
81d57419
authored
20 years ago
by
Lev Walkin
Browse files
Options
Downloads
Patches
Plain Diff
printing charsdefn values
parent
d1b4ac38
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
libasn1fix/asn1fix_misc.c
+16
-0
16 additions, 0 deletions
libasn1fix/asn1fix_misc.c
with
16 additions
and
0 deletions
libasn1fix/asn1fix_misc.c
+
16
−
0
View file @
81d57419
...
...
@@ -60,6 +60,22 @@ asn1f_printable_value(asn1p_value_t *v) {
case
ATV_MAX
:
return
"MAX"
;
case
ATV_FALSE
:
return
"FALSE"
;
case
ATV_TRUE
:
return
"TRUE"
;
case
ATV_TUPLE
:
ret
=
snprintf
(
buf
,
sizeof
(
buf
),
"{%d, %d}"
,
(
int
)(
v
->
value
.
v_integer
>>
4
),
(
int
)(
v
->
value
.
v_integer
&
0xff
));
if
(
ret
>=
(
ssize_t
)
sizeof
(
buf
))
memcpy
(
buf
+
sizeof
(
buf
)
-
4
,
"..."
,
4
);
return
buf
;
case
ATV_QUADRUPLE
:
ret
=
snprintf
(
buf
,
sizeof
(
buf
),
"{%d, %d, %d, %d}"
,
(
int
)((
v
->
value
.
v_integer
>>
24
)
&
0xff
),
(
int
)((
v
->
value
.
v_integer
>>
16
)
&
0xff
),
(
int
)((
v
->
value
.
v_integer
>>
8
)
&
0xff
),
(
int
)(
v
->
value
.
v_integer
&
0xff
));
if
(
ret
>=
(
ssize_t
)
sizeof
(
buf
))
memcpy
(
buf
+
sizeof
(
buf
)
-
4
,
"..."
,
4
);
return
buf
;
case
ATV_STRING
:
case
ATV_UNPARSED
:
/* Buffer is guaranteed to be null-terminated */
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment