Show HN: SLFG: We Made Gets() Safe. Everyone Said It Was Impossible
For decades, C programmers banned gets(). We found a way.
Two simple rules. Four lines of code. Perfect safety.
No more fgets() complexity. No more buffer overflows.
See how: https://github.com/Ferki-git-creator/slfg This is nonsense. The error is here: > buffer[4] = '\n' — puts a newline at the last position > gets(buffer) — the function stops when it hits that newline But gets() doesn't stop when it hits that newline. It stops when a newline appears in the input stream, not in the buffer the input is being copied to. Besides, good luck finding a modern compiler that still supports gets() at all. Thank you, your criticism is at least technical, another comment under this post is completely rude. slurping a bit too much from the AI hose. go back to python land.