Skip to content
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

smaller which #1776

Merged
merged 3 commits into from
Dec 24, 2023
Merged

smaller which #1776

merged 3 commits into from
Dec 24, 2023

Conversation

ccoffing
Copy link
Contributor

No description provided.

@ghaerr
Copy link
Owner

ghaerr commented Dec 24, 2023

Hello @ccoffing,

Nice rewrite. Now that you've rewritten this for size and removed printf, why not remove all of stdio (~1500 bytes) as well? Suggest perhaps using the following style defines (modified from elkscmd/file_utils/futils.h as outstr or similar), and just call write instead using STDOUT_FILENO:

#define errmsg(str) write(STDERR_FILENO, str, sizeof(str) - 1)
#define errstr(str) write(STDERR_FILENO, str, strlen(str))

Would you like to do something like that or commit this as is?

Thank you!

@ccoffing
Copy link
Contributor Author

Oh yeah, good catch. I forget sometimes that puts is not lightweight...

@ghaerr ghaerr merged commit dc333d4 into ghaerr:master Dec 24, 2023
1 check passed
@ccoffing ccoffing deleted the fix-which branch December 24, 2023 18:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants