News for hackers. Stuff that matters.
Re:Curl doesn’t spew binary anymore by userbinator on Saturday June 17, 2017 @11:33AM (#14576301)
I would agree as well that the code looks great and quite "idiomatic C"; but I'd prefer using 2048 and put the memchr() in the same if with another &&.
Re:Curl doesn’t spew binary anymore by baby on Sunday June 18, 2017 @02:53AM (#14579363)
What's the advantage of 2048 over 2000?
Re:Curl doesn’t spew binary anymore by tonmoy on Saturday June 17, 2017 @12:06PM (#14576435)
I think putting the memchr() in the same if would cause unnecessary calling of the memch() function (and scanning of 2000 bytes) even when any of the other conditions is false! It will work great on a language like ruby, not C.
Re:Curl doesn’t spew binary anymore by userbinator on Saturday June 17, 2017 @12:28PM (#14576523)
C && is short-circuit-evaluated. Something like 'if (y && (k = x/y))' won't crash if y is 0.