HackerTrans
トップ新着トレンドコメント過去質問紹介求人

okl

no profile record

投稿

Atlas of Humanity

atlasofhumanity.org
3 ポイント·投稿者 okl·16 日前·0 コメント

The Everyday Projects

everydayprojects.org
3 ポイント·投稿者 okl·16 日前·0 コメント

Show HN: Mutex Service – Team Coordination Tool

mutex.team
1 ポイント·投稿者 okl·7 か月前·0 コメント

Wikipedia: Incrementalism

en.wikipedia.org
2 ポイント·投稿者 okl·9 か月前·1 コメント

コメント

okl
·13 日前·議論
strncpy was originally used to write into fixed length buffers[1]. This becomes obvious when considering the padding behavior, as described in the C standard[2]: "If the array pointed to by s2 is a string that is shorter than n characters, null characters are appended to the copy in the array pointed to by s1, until n characters in all have been written."

strlcpy, often touted as a replacement, does not elicit the padding behavior but has another flaw: It is supposed to return the length of the string it tried to create, for example, so the user can call realloc without calling strlen again.[3] However, this final "strlen-tail" in strlcpy isn't bounded by the size parameter which describes dest, not src.

While strscpy is a marked improvement, there is still something to be careful about: It can read past the end of the src-buffer, when sizeof src < sizeof dest and src is not nul-terminated.[4] (Set the count argument to something like min(sizeof dest, sizeof src) to avoid that).

--

[1] - https://softwareengineering.stackexchange.com/a/438090

[2] - https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3220.pdf, 7.26.2.5 p. 3

[3] - https://manpages.debian.org/jessie/libbsd-dev/strlcpy.3.en.h...

[4] - https://manpages.debian.org/testing/linux-manual-4.8/strscpy...
okl
·9 か月前·議論
Also there is garage, which I found easy to setup: https://garagehq.deuxfleurs.fr/
okl
·9 か月前·議論
Game theoretic modelling commonly results in early escalation followed by a slower de-escalating as a winning strategy. Fits into the strong-arm approach to politics of exercising power to expand power which the current US administration seems to follow. Thus, I wouldn't think that decoupling or falling of a cliff is the intended goal.
okl
·9 か月前·議論
Did you know that 90% of gamblers quit before they win big? /s
okl
·9 か月前·議論
Problem here is that the excessive focus on secondary issues raises the perception of a problem solving deficit which reduces support/legitimacy for the political system.

It would be nice to focus on solving more existential problems of which there are enough.
okl
·10 か月前·議論
https://c-ares.org/
okl
·5 年前·議論
> If a major FOSS Linux distro decided to add a virus to their latest release, would you say the same thing?

https://www.eff.org/deeplinks/2012/10/privacy-ubuntu-1210-am...
okl
·5 年前·議論
I agree that it was a dick move from his side. Fork his project, or use an older version. I am not convinced that him breaking his code is something that ought to be punished.

GitHub gets the right to close their hand while Marak doesn't.
okl
·5 年前·議論
Exactly.
okl
·5 年前·議論
How do you know that when you don't know what else he was using his GitHub account for?
okl
·5 年前·議論
Not different from Google shutting down someone's account, something that's constantly bemoaned on Hacker News.
okl
·5 年前·議論
Instead of the government, we let corporations repress deviants.
okl
·5 年前·議論
Using someone's code (for free) doesn't mean you can dictate terms to them.
okl
·5 年前·議論
Well fuck them. It's his code, he should be able to do with it whatever he wants.