Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The error occurs when a tab number greater than one is given, which will
cause obconf to crash with a segmentation violation. For example, typing
'obconf --tab 2' on the console will crash insteading of launching a GUI
with tab 2 selected. The error is caused by using the MAX macro with a
first argument that is not an idempotent expression (file main.c, line
number 135):
where MAX is defined in file /usr/include/x86_64-linux-gnu/sys/param.h:
where the result will be the first argument a if it is more than the
second argument b, otherwise the result will be b, ie, the result will
be the maximum of a or b. Notice that a or b will be evaluated twice,
depending on the > comparison, which means that a and b should always be
idempotent expression, assuming that the compiler does not generate code
to cache a and b values as intermediate results.
In our case, if the argument counter i is zero or one, a will be
evaluated once, but if it is two or more, a will be evaluated twice,
which means that the argv array will be accessed past its natural end.