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
4645db07
Commit
4645db07
authored
Nov 18, 2017
by
Lev Walkin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
slash-terminate differently
parent
34df4e57
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
8 deletions
+16
-8
asn1c/asn1c.c
asn1c/asn1c.c
+16
-8
No files found.
asn1c/asn1c.c
View file @
4645db07
...
...
@@ -63,15 +63,13 @@ main(int ac, char **av) {
int
print_arg__fix_n_print
=
0
;
/* Fix and print */
int
warnings_as_errors
=
0
;
/* Treat warnings as errors */
char
*
skeletons_dir
=
NULL
;
/* Directory with supplementary stuff */
char
destdir
[
PATH_MAX
];
/* Destination directory
for generated files */
char
*
destdir
=
NULL
;
/* Destination
for generated files */
asn1p_t
*
asn
=
0
;
/* An ASN.1 parsed tree */
int
ret
;
/* Return value from misc functions */
int
ch
;
/* Command line character */
int
i
;
/* Index in some loops */
int
exit_code
=
0
;
/* Exit code */
destdir
[
0
]
=
'\0'
;
/*
* Process command-line options.
*/
...
...
@@ -187,9 +185,19 @@ main(int ac, char **av) {
skeletons_dir
=
optarg
;
break
;
case
'D'
:
strncat
(
destdir
,
optarg
,
PATH_MAX
-
2
);
/* leave room for possible trailing '/' */
if
(
destdir
[
strlen
(
destdir
)
-
1
]
!=
'/'
)
strcat
(
destdir
,
"/"
);
if
(
optarg
&&
*
optarg
)
{
size_t
optarg_len
=
strlen
(
optarg
);
free
(
destdir
);
destdir
=
calloc
(
1
,
optarg_len
+
2
);
/* + "/\0" */
assert
(
destdir
);
strcpy
(
destdir
,
optarg
);
if
(
destdir
[
optarg_len
-
1
]
!=
'/'
)
{
destdir
[
optarg_len
]
=
'/'
;
}
}
else
{
free
(
destdir
);
destdir
=
NULL
;
}
break
;
case
'v'
:
fprintf
(
stderr
,
"ASN.1 Compiler, v"
VERSION
"
\n
"
COPYRIGHT
);
...
...
@@ -382,8 +390,8 @@ main(int ac, char **av) {
* Compile the ASN.1 tree into a set of source files
* of another language.
*/
if
(
asn1_compile
(
asn
,
skeletons_dir
,
destdir
,
asn1_compiler_flags
,
ac
+
optind
,
optind
,
av
-
optind
))
{
if
(
asn1_compile
(
asn
,
skeletons_dir
,
destdir
?
destdir
:
""
,
asn1_compiler_flags
,
ac
+
optind
,
optind
,
av
-
optind
))
{
exit_code
=
EX_SOFTWARE
;
}
...
...
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