Re: [dev] [sic]: patches for string handling

From: Mark Edgar <>
Date: Thu, 24 Sep 2009 00:16:38 +0200

On Wed, Sep 23, 2009 at 3:27 PM, Anselm R Garbe <> wrote:
> 2009/9/22 Mark Edgar <>:
>> * Use strcmp() instead of strncmp() where appropriate
> Applied.

You missed one of these because it was mixed in with the startswith()
change (patch attached).

>> I have more changes, including getting rid of calls to strlen(),
>> fixing the blocking I/O issues, and fixing the IRC protocol parsing in
>> parsesrv().  The cumulative line count delta for these changes is
>> actually negative (down to 245 lines).  I should probably just attach
>> these now too, but I want to start with this one.
> Yes looking forward to it. sic needs some love after all ;)

Perhaps not surprisingly, Kris' changes have basically all the changes
I was about to propose:

replacing a loop over read(1) with fgets()
using a strsep()-like function to parse the server messages
a new swrite(const char *fmt, ...) function
convert printl() to printl(const char *channel, const char *fmt, ...)
a macro to wrap calls to va_start/v*printf/va_end

I also like the dial function (from plan9 I think?).


Received on Wed Sep 23 2009 - 22:16:38 UTC

This archive was generated by hypermail 2.2.0 : Wed Sep 23 2009 - 22:24:01 UTC