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.
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Issue #21] Adds the ability to put count and ratio in the layout. #22
base: master
Are you sure you want to change the base?
[Issue #21] Adds the ability to put count and ratio in the layout. #22
Changes from 7 commits
53917a4
a5a7627
0012689
41f5149
b063e16
70b9469
88a8213
572f702
f6edd4a
28d675f
9b45aac
6679c64
d853880
7f47ae5
7c8cc9e
b26038b
40046c2
bf749b9
136b995
f63c976
93008bb
0f6b118
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't quite understand the failure cases of this function; I might be missing the point, but could it just be "garbage in, garbage out"?
Can you please add tests to
tst-args_cli.c
to cover these cases?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will need to be a strncpy - it will trip the linux package security scanners.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This works, however it's likely to trip the linux package security scanners.
You're correctly using snprintfs and checking bounds, however the scanners are very strict and won't be able to follow the complex logic here.
First thoughts are that we could just a
man 3 regexec
, which is known to safely handle buffers and allocation.Alternatively, we could use
strstr
orstrtok
to find the exact tokens instead of looping, as we don't really need a complex pattern.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can delete this now :)
description_info
can then be moved intolayout_description