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
3251b8e9
Commit
3251b8e9
authored
20 years ago
by
Lev Walkin
Browse files
Options
Downloads
Patches
Plain Diff
printing zeroes in arcs
parent
5a56c7c4
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
skeletons/OBJECT_IDENTIFIER.c
+10
-5
10 additions, 5 deletions
skeletons/OBJECT_IDENTIFIER.c
skeletons/tests/check-OIDs.c
+11
-0
11 additions, 0 deletions
skeletons/tests/check-OIDs.c
with
21 additions
and
5 deletions
skeletons/OBJECT_IDENTIFIER.c
+
10
−
5
View file @
3251b8e9
...
@@ -225,12 +225,17 @@ OBJECT_IDENTIFIER_print_arc(uint8_t *arcbuf, int arclen, int add,
...
@@ -225,12 +225,17 @@ OBJECT_IDENTIFIER_print_arc(uint8_t *arcbuf, int arclen, int add,
&
accum
,
sizeof
(
accum
)))
&
accum
,
sizeof
(
accum
)))
return
-
1
;
return
-
1
;
/* Fill the scratch buffer in reverse. */
if
(
accum
)
{
p
=
scratch
+
sizeof
(
scratch
);
/* Fill the scratch buffer in reverse. */
for
(;
accum
;
accum
/=
10
)
p
=
scratch
+
sizeof
(
scratch
);
*
(
--
p
)
=
(
char
)(
accum
%
10
)
+
0x30
;
for
(;
accum
;
accum
/=
10
)
*
(
--
p
)
=
(
char
)(
accum
%
10
)
+
0x30
;
return
cb
(
p
,
sizeof
(
scratch
)
-
(
p
-
scratch
),
app_key
);
return
cb
(
p
,
sizeof
(
scratch
)
-
(
p
-
scratch
),
app_key
);
}
else
{
*
scratch
=
0x30
;
return
cb
(
scratch
,
1
,
app_key
);
}
}
}
int
int
...
...
This diff is collapsed.
Click to expand it.
skeletons/tests/check-OIDs.c
+
11
−
0
View file @
3251b8e9
...
@@ -291,12 +291,21 @@ main() {
...
@@ -291,12 +291,21 @@ main() {
};
};
int
buf19_check
[]
=
{
2
,
2
,
1
,
1
};
int
buf19_check
[]
=
{
2
,
2
,
1
,
1
};
/* { joint-iso-itu-t 2 1 0 1 } */
uint8_t
buf20
[]
=
{
0x06
,
/* OBJECT IDENTIFIER */
0x04
,
/* Length */
0x52
,
0x01
,
0x00
,
0x01
};
int
buf20_check
[]
=
{
2
,
2
,
1
,
0
,
1
};
CHECK_OID
(
1
);
/* buf1, buf1_check */
CHECK_OID
(
1
);
/* buf1, buf1_check */
CHECK_ROID
(
2
);
/* buf2, buf2_check */
CHECK_ROID
(
2
);
/* buf2, buf2_check */
CHECK_OID
(
3
);
/* buf3, buf3_check */
CHECK_OID
(
3
);
/* buf3, buf3_check */
CHECK_OID
(
4
);
/* buf4, buf4_check */
CHECK_OID
(
4
);
/* buf4, buf4_check */
CHECK_OID
(
19
);
/* buf19, buf19_check */
CHECK_OID
(
19
);
/* buf19, buf19_check */
CHECK_OID
(
20
);
/* buf20, buf20_check */
CHECK_REGEN
(
5
);
/* Regenerate RELATIVE-OID */
CHECK_REGEN
(
5
);
/* Regenerate RELATIVE-OID */
CHECK_REGEN
(
6
);
CHECK_REGEN
(
6
);
...
@@ -320,6 +329,8 @@ main() {
...
@@ -320,6 +329,8 @@ main() {
CHECK_REGEN_OID
(
16
);
CHECK_REGEN_OID
(
16
);
CHECK_REGEN_OID
(
17
);
CHECK_REGEN_OID
(
17
);
CHECK_REGEN_OID
(
18
);
CHECK_REGEN_OID
(
18
);
CHECK_REGEN_OID
(
19
);
CHECK_REGEN_OID
(
20
);
for
(
i
=
0
;
i
<
100000
;
i
++
)
{
for
(
i
=
0
;
i
<
100000
;
i
++
)
{
int
bufA_check
[
3
]
=
{
2
,
i
,
rand
()
};
int
bufA_check
[
3
]
=
{
2
,
i
,
rand
()
};
...
...
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