Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
argo
aml
Commits
f41a6039
Commit
f41a6039
authored
Mar 21, 2019
by
Nicolas Denoyelle
Browse files
fix strtok on constant string
parent
d8ce7667
Pipeline
#6772
passed with stage
in 18 minutes and 44 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/aml.c
View file @
f41a6039
...
...
@@ -19,14 +19,17 @@ int aml_patch_version = -1;
int
aml_get_major_version
(){
if
(
aml_major_version
<
0
){
return
atoi
(
strtok
(
VERSION
,
"."
));
char
version
[
strlen
(
VERSION
)
+
1
];
strcpy
(
version
,
VERSION
);
return
atoi
(
strtok
(
version
,
"."
));
}
return
aml_major_version
;
}
int
aml_get_minor_version
(){
if
(
aml_major_version
<
0
){
char
*
version
=
VERSION
;
char
version
[
strlen
(
VERSION
)
+
1
];
strcpy
(
version
,
VERSION
);
strtok
(
version
,
"."
);
return
atoi
(
strtok
(
version
,
"."
));
}
...
...
@@ -35,7 +38,8 @@ int aml_get_minor_version(){
int
aml_get_patch_version
(){
if
(
aml_major_version
<
0
){
char
*
version
=
VERSION
;
char
version
[
strlen
(
VERSION
)
+
1
];
strcpy
(
version
,
VERSION
);
strtok
(
version
,
"."
);
strtok
(
version
,
"."
);
return
atoi
(
strtok
(
version
,
"."
));
...
...
@@ -45,7 +49,8 @@ int aml_get_patch_version(){
int
aml_init
(
int
*
argc
,
char
**
argv
[])
{
char
*
version
=
VERSION
;
char
version
[
strlen
(
VERSION
)
+
1
];
strcpy
(
version
,
VERSION
);
aml_major_version
=
atoi
(
strtok
(
version
,
"."
));
if
(
aml_major_version
!=
AML_ABI_VERSION
)
return
-
1
;
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment