ku1ik / stderred

stderr in red
MIT License
996 stars 115 forks source link

Always forward fputc to original fputc, with or without colors #54

Closed DanOlivier closed 7 years ago

DanOlivier commented 7 years ago

So LD_PRELOAD will affect every process forked from the console. I hit an application that was affected by the fact that fputc was being silently redirected to fwrite (despite blacklisting). The bug (see #53) was probably due to the differences in the meaning of the return codes. To improve safety, this change (pull request) will not redirect the calls: fputc calls fputc, fwrite calls fwrite, and both will insert coloring commands before and after.

cehoffman commented 7 years ago

Thank for this @DanOlivier, I think these are good changes.

DanOlivier commented 7 years ago

Changes pertaining to __fprintf_chk are in pull #57.