Hacker Newsnew | past | comments | ask | show | jobs | submit | ir3k's commentslogin

Forgot the year of the Linux. It's the year of Pebble! I had a blast on last Rebble hackathon creating watchface named pRebble inspired by Pebble original UI design which I found amazing in how it manifested through work of designers within limitations and constrains of this platform. I can't wait to explore it even more on second hachathon. Looking forward to see Pebble rising from the ashes \(^-^ )


I looked into those points and:

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.


Wow, this is actually very good description of program flow. There are only few small mistakes. For example:

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


Yes, that was my reasoning. Also there is non-written rule in this project that forbids me from going wider than 80 columns. With that I initially had indentation set to 2 spaces but later I realized that code is indented at most 2 times and it's better to make space for goto labels on the left.


That's true and many Gemini clients supports multiple protocols. But in case of this "gmi100" only gemini:// protocol is supported.


Besides GNU/Linux I compiled on MacOS. I made no effort to test on BSD systems or Windows. I included only few std libs so I wonder - what exactly makes it not compatible with OpenBSD?


No, gplaces didn't work. Yours' work fine with a just an extra #include for inet.


Yea it's very hard to read. I'm surprised that people are actually can follow the flow and can understand dirty tricks.

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.


This is such a great feedback. Thank you a lot. OFC I will try to correct my mistakes.

Not to make any excuses, just for the context. I'm a beginner in C programming and I wrote only few small programs. My tooling is basically non existent. I will try to improve tho.


Try "valgrind" to check potential memory leaks and also compile your C projects with -Wall and -Wextra, -pedantic it's fine too.


There's a page on the net somewhere, which was on HN front-page a while ago too, that listed all the useful warning flags for gcc, with an explanation.

I'd look for it, as a C programmer. On phone now, so sadly don't have it handy.


If you or someone else finds the link to this, I would love this!


Not OP, but the one that sticks in my mind¹ with comments². Although, I also could've sworn I commented on it :/

¹ https://nullprogram.com/blog/2023/04/29/

² https://news.ycombinator.com/item?id=35758898


Ah yes, there are couple of line saving tricks like that. Mostly in for loops.

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.


I found out about BearSSL after I had first version of client working. So I kept OpenSSL. I will remember to try BearSSL in next project.


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: