strcmp(1): re-style and tweak exit codes #145

Closed
trinity wants to merge 0 commits from strcmp into main
Owner

strcmp(1)'s exit codes now are what strcmp(3p) returns.

strcmp(1)'s exit codes now are what [strcmp(3p)](https://pubs.opengroup.org/onlinepubs/9699919799.2018edition/functions/strcmp.html) returns.
trinity added the
enhancement
label 2024-07-15 10:29:08 +00:00
trinity added 4 commits 2024-07-15 10:29:09 +00:00
trinity added 1 commit 2024-07-15 10:29:49 +00:00
trinity requested review from emma 2024-07-15 10:32:19 +00:00
emma requested changes 2024-07-15 20:08:17 +00:00
Dismissed
src/strcmp.c Outdated
@ -21,1 +33,3 @@
return -1; /* actually 255 */
for (; *argv[1] != '\0'; ++argv[1]) { /* iterate chars in ref */
/* iterate argc */
for (size_t i = 2 /* ref cmp */; i < argc; ++argv[i], ++i) {
Owner

The word “ref” needs to be clarified.

The word “ref” needs to be clarified.
trinity marked this conversation as resolved
trinity added 1 commit 2024-07-15 20:40:44 +00:00
trinity requested review from emma 2024-07-15 20:40:59 +00:00
emma reviewed 2024-07-15 21:06:53 +00:00
@ -22,2 +39,4 @@
}
}
return 0;
Owner

Should this be return EXIT_SUCCESS; or return EX_OK;?

Should this be `return EXIT_SUCCESS;` or `return EX_OK;`?
Author
Owner

No; strcmp(3) returns 0 specifically.

No; strcmp(3) returns `0` specifically.
emma marked this conversation as resolved
emma approved these changes 2024-07-16 01:01:07 +00:00
Author
Owner

Merged.

Merged.
trinity closed this pull request 2024-07-16 01:53:22 +00:00

Pull request closed

Sign in to join this conversation.
No reviewers
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: bonsai/harakit#145
No description provided.