Skip to content

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
@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