Code from Zed Shaw's "Learn C the Hard Way"