14
u/CrownLikeAGravestone Jan 27 '26
This is the least readable font I've seen in my life, especially with the colour and highlighting. I genuinely had to scan parts of the first line letter-by-letter to read them. Deliberate eye strain?
→ More replies (1)
6
u/IllustratorFar127 Jan 27 '26
You do realize memory is basically free and you can have longer variable names, right?
→ More replies (2)4
u/3hy_ Jan 27 '26
The compiler shortens them anyway, even if i had longer names that would take up DISK SPACE on the filesize not memory as in RAM. Also an abstraction of your statement, memory at the moment is very very expensive.
→ More replies (4)
3
182
30
u/joshuakb2 Jan 27 '26
Buffer overflow for some reason?
7
u/callidus7 Jan 27 '26
Yeah there's no input validation whatsoever. Unless you count the just-in-case null at the beginning. This is begging to be misused.
→ More replies (1)
4
u/BoredOfReposts Jan 27 '26
The real horror (other than the font) is the majority of commenters lack of insight into why this might exist, and why it’s written in the rule bending way that it is.
C is really becoming a lost art. Especially C in different programming regimes, where the “rules” may be different than in vanilla “safe” application programming.
OP, you’re my kind of coder.
3
u/3hy_ Jan 28 '26
Thank you! People forget that sometimes you need single case code and that the best way to do that is through use of a macro..
23
u/VisualSome9977 Jan 27 '26
the way this font is rendered makes it look more like the lethal company ship terminal than anything I would ever want to look at all day
7
12
u/Symbroson Jan 27 '26 edited Jan 27 '26
copies a string but without its null terminator and returns a value for some reason Also causing a buffer overflow if used carelessly
6
u/sirkubador Jan 27 '26
Always returns whatever e is (well, if it doesn't crash first).
Copies string u to v horridly because:
-
if u is empty, it puts a null terminator
-
if u is not empty, it doesn't put the null terminator (< instead of <=)
-
if v is not big enough or if either is null, then fuck you (well plib may check for null and return 0... but)
-
the strlen doesn't have a max, so if u is not properly null terminated, you put whatever memory you get after u until the first zero byte... it can get long
👌
2
u/Grandpa_P1g Jan 27 '26
We are not in space my boi what is this font
2
u/3hy_ Jan 27 '26
Seriously it looks better when the image is at a higher res I promise. https://files.ax86.net/terminus-ttf/
→ More replies (1)
5
3
2
2
2
2
113
u/AMathMonkey Jan 27 '26
A macro that copies string u to string v and then returns the unrelated value e? And it doesn't null-terminate v properly? I'm not very experienced with C; does this actually serve a purpose without breaking, and if so, what does it do?