Hi Stefan, Stefan Hagen wrote on Tue, Sep 14, 2021 at 07:37:20PM +0200:
> I really appreciate you (and Theo) taking the time to explain > these things. You are welcome, and thank you for trying to help fix stuff (i think i forgot saying that in my previous mail because i got a bit worked up about the horrible code in that file, which has nothing to do with you). > I noticed the weird output, In such a case, it is useful to add a sentence like this: With my patch, it no longer crashes for me, but i'm not completely sure whether it is right because the output looks weird. It prints far too many '0' characters (32 too many if i count correctly) - compare the size of the 0-padding printed to the desired size mentioned in the text "..." printed in the first half of the line before the base-2 number. In general, if you have specific doubts, mentioning them specifically is better than just asking "is it better?" > but couldn't make sense of it as the > upstream version crashes (abort trap) here. > > Regarding my terrible C skills, I think I'll step back from trying to > fix C code for a bit. I'm wasting peoples time here to educate me on > topics I could as well learn elsewhere. (Except you tell me to continue > submitting bad fixes and learn here...). Well, your patch was still half-useful in so far as it correctly spotted the one place in the code that needs to be fixed (i did extensive grepping anyway to make sure, but it is reassuring that we both came to the same conclusion). There is a saying here "bad patches trigger good ones". Also, bug reports that contain *only* a verbal description of the problem or *only* a patch often leave me wondering what the sender is driving at. When *both* a verbal description and a patch are supplied together, even if the patch is bad, it very rarely happens that the intention of the sender remains nebulous. > I feel embarrassed, because I can't even explain why I used > snprintf there. I guess you looked at the rest of the code in the file, which uses lots and lots of superfluous static buffers and lots of pointless snprintf(3). Existence determines consciousness: what code one reads influences what kind of code one writes (though not deterministically, and of course it isn't the only factor). So make sure you read sufficient amounts of good code. Either way, learning from feedback is better than feeling too embarassed. > Your fix looks good to me. But my opinion doesn't matter at this point. Well, a test report from a real-world user is always useful, can make the difference between committing quickly and waiting for more feedback from developers, and is usually acknowledged by something like OK some_developer@, and also tested by <...@...> in the commit message. So thanks for testing and reviewing. Yours, Ingo
