Example code from The C Programming Language, 2nd Edition