News for hackers. Stuff that matters.
Re:Make your STDERR red by wmobit on Tuesday December 13, 2011 @06:01PM (#3349763)
The alloca usage here terrifies me.
Re:Make your STDERR red by burgerbrain on Tuesday December 13, 2011 @06:20PM (#3349831)
That is a good point. I don't know if write has a limit on 'count' (I can't find anything saying that it does), but if it's simply "whatever you can fit in size_t" then you certainly want to be careful about putting that on your stack. Failed alloca's don't really give you any indication, though you might sigsegv later.
Re:Make your STDERR red by sickill on Wednesday December 14, 2011 @04:30AM (#3351218)
What would you suggest instead then? I'm not C programmer.
Re:Make your STDERR red by burgerbrain on Wednesday December 14, 2011 @12:38PM (#3352719)
Avoid the allocation entirely. Use writev for example (or just use multiple 'write's, if you don't care about it being atomic).
Re:Make your STDERR red by sickill on Wednesday December 14, 2011 @03:11PM (#3353395)