Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
asn1c
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Libraries
asn1c
Commits
c7549b1b
Commit
c7549b1b
authored
Sep 17, 2006
by
Lev Walkin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
problem fixed
parent
af63a91e
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
5 deletions
+9
-5
skeletons/BMPString.c
skeletons/BMPString.c
+2
-1
skeletons/UTF8String.c
skeletons/UTF8String.c
+7
-4
No files found.
skeletons/BMPString.c
View file @
c7549b1b
...
...
@@ -111,7 +111,7 @@ BMPString_decode_xer(asn_codec_ctx_t *opt_codec_ctx,
if
(
1
)
{
/* Swap byte order and trim encoding to 2 bytes */
uint32_t
*
wc
=
wcs
;
uint32_t
*
wc_end
=
wcs
+
wcs_len
+
1
;
uint32_t
*
wc_end
=
wcs
+
wcs_len
;
uint16_t
*
dstwc
=
(
uint16_t
*
)
wcs
;
for
(;
wc
<
wc_end
;
wc
++
,
dstwc
++
)
{
uint32_t
wch
=
*
wc
;
...
...
@@ -131,6 +131,7 @@ BMPString_decode_xer(asn_codec_ctx_t *opt_codec_ctx,
rc
.
consumed
=
0
;
return
rc
;
}
else
{
dstwc
[
2
*
wcs_len
]
=
0
;
wcs
=
(
uint32_t
*
)
dstwc
;
}
}
...
...
skeletons/UTF8String.c
View file @
c7549b1b
/*-
* Copyright (c) 2003, 2004 Lev Walkin <vlm@lionet.info>. All rights reserved.
* Copyright (c) 2003, 2004, 2006 Lev Walkin <vlm@lionet.info>.
* All rights reserved.
* Redistribution and modifications are permitted subject to BSD license.
*/
#include <asn_internal.h>
...
...
@@ -103,6 +104,7 @@ UTF8String__process(const UTF8String_t *st, uint32_t *dst, size_t dstlen) {
size_t
length
;
uint8_t
*
buf
=
st
->
buf
;
uint8_t
*
end
=
buf
+
st
->
size
;
uint32_t
*
dstend
=
dst
+
dstlen
;
for
(
length
=
0
;
buf
<
end
;
length
++
)
{
int
ch
=
*
buf
;
...
...
@@ -127,7 +129,7 @@ UTF8String__process(const UTF8String_t *st, uint32_t *dst, size_t dstlen) {
/* Check character sequence length */
if
(
buf
+
want
>
end
)
return
U8E_TRUNC
;
value
=
ch
&
(
0xff
>>
(
want
+
1
)
);
value
=
ch
&
(
0xff
>>
want
);
cend
=
buf
+
want
;
for
(
buf
++
;
buf
<
cend
;
buf
++
)
{
ch
=
*
buf
;
...
...
@@ -136,10 +138,11 @@ UTF8String__process(const UTF8String_t *st, uint32_t *dst, size_t dstlen) {
}
if
(
value
<
UTF8String_mv
[
want
])
return
U8E_NOTMIN
;
if
(
dstlen
)
*
dst
++
=
value
;
/* Record value */
if
(
dst
<
dstend
)
*
dst
++
=
value
;
/* Record value */
}
if
(
dst
len
)
*
dst
=
0
;
/* zero-terminate */
if
(
dst
<
dstend
)
*
dst
=
0
;
/* zero-terminate */
return
length
;
}
...
...
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