|
From: xevuz <xe...@us...> - 2007-07-15 11:21:52
|
Update of /cvsroot/chix/chix/src/lib In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv22951/src/lib Modified Files: chix.c chix_packet.c chix_status.c Log Message: aaahhhh\!\! type == 5 not 4\!\!\! Index: chix_status.c =================================================================== RCS file: /cvsroot/chix/chix/src/lib/chix_status.c,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 --- chix_status.c 15 Jul 2007 10:03:47 -0000 1.9 +++ chix_status.c 15 Jul 2007 11:21:35 -0000 1.10 @@ -21,7 +21,7 @@ #include "Chix.h" /* - * Login away status (when buddy list is retrieved} is indexed + * Login away status (when buddy list is retrieved) is indexed * 0-3. But when buddy changes away status, its indexed 0-5 with * 1 and 3 are ignored. 3 means the buddy's mood changed. * The member 'type' is what we send to the server and what we @@ -60,8 +60,7 @@ CHIX_INTERN int chix_status_away_set_extern(Chix_Status *stat, int away) { - if ((away > 3) || (away < 0)) - return -1; + if ((away > 3) || (away < 0)) return -1; stat->away = away; return _status_away[away].type; } @@ -69,8 +68,7 @@ CHIX_INTERN void chix_status_away_set_intern(Chix_Status *stat, int away) { - if ((away > 5) || (away < 0)) - return; + if ((away > 5) || (away < 0)) return; switch (away) { @@ -103,16 +101,15 @@ CHIX_INTERN int chix_status_away_get(Chix_Status *stat, char *buf, int size) { - if ((!buf) || (size < 15)) return stat->away; - printf("%i\n", stat->away); - snprintf(buf, size, "%s", _status_away[stat->away].string); + if ((buf) && (size > 15)) + snprintf(buf, size, "%s", _status_away[stat->away].string); return stat->away; } CHIX_INTERN int chix_status_mood_get(Chix_Status *stat, char *buf, int size) { - if ((!buf) || (size < 15)) return stat->mood; - snprintf(buf, size, "%s", _status_mood[stat->mood]); + if ((buf) && (size > 15)) + snprintf(buf, size, "%s", _status_mood[stat->mood]); return stat->mood; } Index: chix.c =================================================================== RCS file: /cvsroot/chix/chix/src/lib/chix.c,v retrieving revision 1.27 retrieving revision 1.28 diff -u -d -r1.27 -r1.28 --- chix.c 15 Jul 2007 10:03:47 -0000 1.27 +++ chix.c 15 Jul 2007 11:21:35 -0000 1.28 @@ -474,7 +474,7 @@ { /* The buddy's away status changed */ chix_status_away_set_intern(&bud->stat, type); - if (type == 4) bud->pc = 0; + if (type == 5) bud->pc = 0; } chix_event_set(cl, bud, EVENT_BUDDY_NOTIFY, 0, NULL); Index: chix_packet.c =================================================================== RCS file: /cvsroot/chix/chix/src/lib/chix_packet.c,v retrieving revision 1.17 retrieving revision 1.18 diff -u -d -r1.17 -r1.18 --- chix_packet.c 10 Jul 2007 16:46:26 -0000 1.17 +++ chix_packet.c 15 Jul 2007 11:21:35 -0000 1.18 @@ -254,7 +254,7 @@ if ((len < 11) || (str[0] != 0x02) || (str[pos] != 0x09)) { - printf("Packet seems to be smelly.\n"); + printf("Packet smells like a stale rat.\n"); printf("%s\n", str); return 0; } |