Monthly Archives: September 2010

Safer string manipulation in C

strncpy does not append a terminating 0 if the source buffer if it’s too long to fit into the destination buffer. strncat requires the programmer to keep track of how much space there is left in the destination buffer. The … Continue reading

Posted in Uncategorized | Leave a comment

On patches and whitespace

We don’t write much code in assembly these days (maybe some people still do). Instead we write most of our programs in a second, third or fourth generation programming language (are there any fifth generation ones yet?). This is because … Continue reading

Posted in Uncategorized | Tagged , , , | Leave a comment

Get better at awk/sed/grep

This nice blog post illustrates some very handy usages of awk/grep/sed. It also includes examples in Perl but I find that on platforms where Perl is available then Python is not far away :) http://www.catonmat.net/blog/golfing-the-extraction-of-ip-addresses-from-ifconfig This page lists some redundant … Continue reading

Posted in Uncategorized | Tagged , , , , | Leave a comment