2006.Dec.31
Filed under: Programming — jon @ 11:16

Two things you never ever want to see in a chunk of (production) C/C++ code:

void someReadFunction(char *buf, size_t buflen)
{
   ...
   pos = -1;
end:
   buf[pos] = '\\0';
   return pos;
}

And no, the programmer wasn’t advancing buf in the omitted part of the function.

No Comments »

No comments yet.

RSS feed for comments on this post. TrackBack URI

Leave a comment

  • dreamhost.com logo
    Happily hosted by dreamhost.com
  • This site is green.
  • Bike Month
    miles biked47.50
    gallons saved1.36
    dollars saved$5.22
    pounds CO2 saved26.60
    calories burned1677