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
Terminal write and erase improvements #1320
Terminal write and erase improvements #1320
Changes from 7 commits
6e9a978
6aa442b
f048046
f544331
a0bc540
8877942
d783fa1
745939f
be2ba0d
e30e802
eefa904
b6d3429
fbee16b
ae0d7c6
0865e75
c74bbc2
ff618b1
32f59d7
936d7ea
eb2e346
0a5d1eb
5facea9
9a7d532
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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 is not wrong, but tradition has it that argv lists are terminated by NULL, so just for superstition, I'd write
char *args[] = {"write", memtype, "", "", "0xff", "...", NULL};
Admittedly, it's unlikely that the write code ever looks for the terminating NULL.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.
Thanks for your input, I wasn't aware of this so if I add a NULL to the args array, should I pass 6 or 7 as the argc number to cmd_write?
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.
argc must be 6 (no change)
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.
https://en.cppreference.com/w/cpp/language/main_function
argc - Non-negative value representing the number of arguments passed to the program from the environment in which the program is run.
argv - Pointer to the first element of an array of argc + 1 pointers, of which the last one is null and the previous ones, if any, point to null-terminated multibyte strings that represent the arguments passed to the program from the execution environment. If argv[0] is not a null pointer (or, equivalently, if argc > 0), it points to a string that represents the name used to invoke the program, or to an empty string.
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 had a look at the
tokenize()
function that provides the argc, argv pair for all the commands in the terminal. Indeed, that uses a terminating NULL (as convention has it). So better to change that line tochar *args[] = {"write", memtype, "", "", "0xff", "...", NULL};