52 karma · joined Jul 19, 2023 (3y ago) · 13 submissions
comment 1y ago · link · parent
comment 3y ago · link · parent
1. `sfd` is now closed. This cost me an extra line of code tho so I had to improvise.
2. `j` was not initially -1 as even empty input contains one "\n" character. But it could go pass value of 0 underflowing the buffer when buffer contained only white space characters (like in case of single "\n"). This was corrected.
3. `h_addr_list[i]` about this one. I'm quite sure I took it from example in one of man pages. Anyway, I replaced it with `memcpy`.
I also tried to use valgrind. This is OFC my first step but I will continue my studies on detecting memory leaks in future projects.
comment 3y ago · link · parent
> navigate through the history (when input starts with a digit)
Should be more like: navigate to link from currently displayed page (when input starts with a digit).
> It prints the response to `stdout` and also stores it in the temporary file.
Response is not printed to `stdout` at all. It is only stored in temporary file.
Also the possibility to use first program argument to overwrite the `less` command was ignored.
But overall very good job.
comment 3y ago · link · parent
comment 3y ago · link · parent
The most unreadable code would be the code that was intentionally obfuscated. Here I at least try to pretend that it is readable in some parts.
Thanks for kind words.
comment 3y ago · link · parent
Thanks for suggestion. I will go through code again to see if I can save more space with normal code.
Actually that was my workflow. Each time I managed to write something in simpler way I reverted few tricks.
13.
Show HN: Gemini web client in 100 lines of C(github.com ↗)
91 points · by ir3k · 3y ago · 45 comments