Thank you so much for pointing out the problems with my patch - I didn't know about __dead until I saw your counter-patch, so I'm glad I learned something new. I somehow totally missed those other two printit()s (super derpy of me).
For the lurkers on the list (I got an email from one already), I did a little post-mortem on my patch, first running basic tests on the three different paths that uses printit: $ echo abcxyz | /usr/games/caesar ghidef $ echo abcxyz | ./caesar ghidef $ echo abcxyz | /usr/games/caesar 4 efgbcd $ echo abcxyz | ./caesar 4 efgbcd $ echo abcxyz | /usr/games/rot13 nopklm $ echo abcxyz | ./rot13 nopklm Odd, because you'd think the second printit would have fired a duplicate set of output. Except it isn't. That's because the first pass of printit reaches the end of the stdin stream with getchar. With the second printit, there's nothing from the stream (a possible race condition, still bad news). I'm really enjoying OpenBSD so far, probably the most fun in computing I've had in a long time :-) Thanks! On Thu, Jul 03, 2014 at 10:32:45PM +0200, Ingo Schwarze wrote: > Hi, > > David Crosby wrote on Thu, Jul 03, 2014 at 07:44:12AM -0600: > > > This little patch fixes a compiler warning > > i just committed my version of the fix. > Thanks to David for reporting the issue > and to Miod for checking my patch. > > Yours, > Ingo >
