OK, I'm fairly happy with this, except that so far I've only lightly tested it.
Summary of changes: Move the getaddrinfo/socket/connect dance to dial(), replacing memset(&hints) with hints={0} Replace read(1)*n with fgets() Replace snprintf(), strlen(), write() with fprintf(), and corresponding simplifications in parsein() Replace snprintf(), strlen(), printl() with variadic printl(), and corresponding simplifications in parsesrv() Now 226 lines. The majority of the credit for these changes goes to Kris. -Mark
sic-tip-stdio.diff
Description: Binary data