Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Peje Nilsson
aniara
Commits
5256425c
Commit
5256425c
authored
Jan 22, 2020
by
ALIS superuser
Browse files
goptaverk: fixed bug causing segfault, improved error messages on missing variables
parent
09697762
Changes
1
Hide whitespace changes
Inline
Side-by-side
mima/goptaverk.c
View file @
5256425c
...
...
@@ -459,6 +459,14 @@ static gopta_t *goptainit(int *barf, int *fd)
SETBARF
(
barf
,
errno
,
"Couldn't malloc %d bytes (%d * %d items)"
,
sizeof
(
item_t
)
*
g
->
nitems
,
sizeof
(
item_t
),
g
->
nitems
);
}
else
/* Set all stringpointers to NULL to avoid segfault on free */
{
for
(
i
=
0
;(
i
<
g
->
nitems
)
&&
(
*
barf
==
0
);
i
++
)
{
g
->
itp
[
i
].
expose
=
NULL
;
g
->
itp
[
i
].
position
=
NULL
;
}
}
/* itemN */
for
(
i
=
0
;(
i
<
g
->
nitems
)
&&
(
*
barf
==
0
);
i
++
)
...
...
@@ -472,6 +480,7 @@ static gopta_t *goptainit(int *barf, int *fd)
}
s
=
findvar_stri
(
barf
,
GOPTA_FILTER
,
i
);
symbarfi
(
barf
,
GOPTA_FILTER
,
i
);
if
(
s
!=
NULL
)
{
getfilterpos
(
barf
,
fd
,
&
g
->
itp
[
i
].
filter
,
s
);
...
...
@@ -480,7 +489,9 @@ static gopta_t *goptainit(int *barf, int *fd)
timerclear
(
&
g
->
itp
[
i
].
filter_change_time
);
g
->
itp
[
i
].
expose
=
findvar_stri
(
barf
,
GOPTA_EXPOSE
,
i
);
symbarfi
(
barf
,
GOPTA_EXPOSE
,
i
);
g
->
itp
[
i
].
position
=
findvar_stri
(
barf
,
GOPTA_POSITION
,
i
);
symbarfi
(
barf
,
GOPTA_POSITION
,
i
);
}
}
...
...
Write
Preview
Supports
Markdown
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