Use (ir)regular expressions:
(Understanding the regexps and the code and converting it to C is left as an exercise for the reader)
(define nick-regex #px":([][\\`_^{}|[:alpha:]-][][\\`_^{}|[:alnum:]-]*)(?:!([^\\s!@]+))?(?:@([^\\s]+))?")
(define server-regex
#px":(?:(?:[[:alnum:]]+(?:\\.[[:alnum:]-]+)+)|(?:\\d{,3}\\.\\d{,3}\\.\\d{,3}\\.\\d{,3})|(?:(?:[[:xdigit:]]?(?::[[:xdigit:]]?)+)|(?:0:0:0:0:0:(?:0|FFFF):\\d{3}\\.\\d{3}\\.\\d{3}\\.\\d{3})))")
(define message-regex #px"^(?:(:[[:graph:]]+) )?([[:alpha:]]+|[0-9]{3})(?: ((?:[^:\0\\s]\\S* ?){,14}))?(:[^\0\r\n]*)?\r?\n?$")
This should give you some tips on the proper behaviour your client should implement.
In your code snipped, whenever someone sends you a PRIVMSG/NOTICE that included "Checking Ident" (which is not sent by all servers, mind you), you will send a USER and NICK message to the server...
It just seems C is not for you, but fear not! There are languages where nice looking turtles move on screen and draw stuff. You should try one of them.
Why not look at some code that sucks less? ii is the best irc client, because it doesn't force a crappy graphical user interface on you. You can, for instance, use echo and tail -f to write and read channels. The code is simple since it's only the irc stuff: http://hg.suckless.org/ii/file/d163c8917af7/ii.c
Name:
Anonymous2012-04-02 4:38
Remember the two rules.
1. If it ain't Lisp, it's crap.
2. Lisp is shit.
Name:
Anonymous2012-04-03 14:56
parse => perl
Name:
Anonymous2012-04-03 15:03
sprintf
U MENA std::stringstream!??!?!?!!??!
Name:
Anonymous2012-04-03 16:21
``IRC clients'' are for faggots. Real men open a socket and type in the commands.