Readit News logoReadit News
fjfaase commented on US to Take Part in Russia's Eurovision, Joining Belarus, Cuba and Venezuela   politico.eu/article/us-ta... · Posted by u/saubeidl
fjfaase · 2 days ago
As an European, I am wondering how Americans are feeling about the USA government more and more siding with authoritarian countries (some of which are performing war crimes on a large scale) instead with democratic countries.
fjfaase commented on Show HN: Uprintf a universal stb-style printf implementation for C (no OS)    · Posted by u/Forgret
wahern · 2 days ago
It was first added to the Single UNIX Specification (SUS) in 1997. Perhaps there was some oddball non-conformant implementation at the time, but in those cases the standard would usually use a different name.

There's the infamous strncpy, of course, which understandably could cause some confusion. And various non-vendor faux-snprintf implementations, like uprintf, that have different semantics. It's hazardous to reuse a standardized name like snprintf, even as a suffix, in an API but not implement the same fundamental semantics.

fjfaase · 2 days ago
I got this wrong from Microsoft Visual Studio (before 2015 and Windows 10) where the function snprintf did not add the null character. The function _snprintf still has the behavior that it does not add the null character.

See section 'Remark' on: https://learn.microsoft.com/en-us/cpp/c-runtime-library/refe...

fjfaase commented on Show HN: Uprintf a universal stb-style printf implementation for C (no OS)    · Posted by u/Forgret
wahern · 3 days ago
> I always have understood that snprintf does not write a null character when the produced string is longer than the given size.

snprintf always null-terminates when the buffer length is greater than 0 and there's no error. That is, if snprintf returns >= 0 and the buffer length is > 0, the output is null-terminated.

This should be clear from your local snprintf(3) man page (e.g. https://man.openbsd.org/snprintf), but also see the C23 standard (https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3220.pdf) and POSIX (https://pubs.opengroup.org/onlinepubs/9799919799/).

fjfaase · 3 days ago
You are right. I verified this myself. I do not know where I got this wrong. Maybe this was different in earlier implementations.
fjfaase commented on Show HN: Uprintf a universal stb-style printf implementation for C (no OS)    · Posted by u/Forgret
fjfaase · 4 days ago
Nice work. I always have understood that snprintf does not write a null character when the produced string is longer than the given size. The snprintf function also can be called with a null pointer to calculate the length of the produced string.

You could add a c file with some unittests.

fjfaase commented on New Zealand woman and six-year-old son detained for three weeks   theguardian.com/world/202... · Posted by u/perihelions
fjfaase · 10 days ago
It is this kind of stories that are keeping many foreigners from visiting the USA. As long as this administration is in power, I will not even consider to travel to the USA and not work for companies that might require traveling to the USA.
fjfaase commented on Fire hazard of WHY2025 badge due to 18650 Li-Ion cells   wiki.why2025.org/Badge/Fi... · Posted by u/fjfaase
Waterluvian · 15 days ago
Engineering is the first 80% of work. But productization is the second 80%. I find that the more nerdy a community or product audience, the more the latter suffers.
fjfaase · 14 days ago
This is right. But this time that was not the primary reason. From earlier experiences, Badge.Team, started well ahead of time and were on schedule, but things went wrong after some drama with the WHY2025 organization.
fjfaase commented on Fire hazard of WHY2025 badge due to 18650 Li-Ion cells   wiki.why2025.org/Badge/Fi... · Posted by u/fjfaase
stavros · 18 days ago
Why was that advice ignored?
fjfaase · 18 days ago
Often it is the case that safety concerns are overruled by less technical savvy managers for some lesser critical reason.
fjfaase commented on Fire hazard of WHY2025 badge due to 18650 Li-Ion cells   wiki.why2025.org/Badge/Fi... · Posted by u/fjfaase
jon-wood · 18 days ago
Please don't post LLM summaries without any additional context. If I wanted one I'd ask my nearest LLM for it.
fjfaase · 18 days ago
Sorry, but I was not aware that the text with the submit (which I wanted to keep short) appears as a comment, otherwise, I would have given more details or left it out.
fjfaase commented on Fire hazard of WHY2025 badge due to 18650 Li-Ion cells   wiki.why2025.org/Badge/Fi... · Posted by u/fjfaase
exmadscientist · 18 days ago
> The WHY2025 badge was designed to be powered by 2 Li-Ion 18650 battery cells connected in parallel. The cells provided to visitors are of the "unprotected" kind

...I am going to put on my "client-facing consultant" hat for a moment, which means skipping the expletives, and just say that not only is this a Very Bad Design, it is such a Very Bad Design that someone should really have noticed this and not let it happen.

Because this really is a Startlingly Bad Idea.

fjfaase · 18 days ago
An earlier design by Badge.Team [1] did not use these cells and Badge.Team (no longer associated with WHY2025) strongly advised against the use of these cells.

The earlier design has been matured into Konsool [2] and is available as Tanmatsu [3].

[1] https://badge.team/

[2] https://badge.team/docs/badges/konsool/

[3] https://nicolaielectronics.nl/tanmatsu/

u/fjfaase

KarmaCake day1606March 20, 2017
About
Software engineer with more than 30 years experience writing software in mostly C++. Interest in parsers, interpreters and combinatorics problems.

Working as a senior (embedded) software developer at KITT Engineering (kitt.nl).

* https://www.iwriteiam.nl/ * https://github.com/FransFaase * https://fjfaase.at.hn

View Original