cvs: php4 /ext/ircg ircg.c

From: Date: Wed, 10 Jan 2001 19:07:23 +0000
Subject: cvs: php4 /ext/ircg ircg.c
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-3544@lists.php.net to get a copy of this message
sas Wed Jan 10 11:07:23 2001 EDT Modified files: /php4/ext/ircg ircg.c Log: Fix a bug of the D'oh! class (RETVAL instead of RETURN), let the first irconn_id be 1 and allow empty strings as format strings. Index: php4/ext/ircg/ircg.c diff -u php4/ext/ircg/ircg.c:1.12 php4/ext/ircg/ircg.c:1.13 --- php4/ext/ircg/ircg.c:1.12 Wed Jan 10 07:52:01 2001 +++ php4/ext/ircg/ircg.c Wed Jan 10 11:07:23 2001 @@ -31,7 +31,7 @@ static HashTable h_fd2irconn; static HashTable h_irconn; -static int irconn_id; +static int irconn_id = 1; /* Format string numbers */ enum { @@ -536,7 +536,7 @@ conn, server, port, &conn->conn)) { free(conn->username); free(conn); - RETVAL_FALSE; + RETURN_FALSE; } if (p4) { HashTable *h; @@ -545,8 +545,8 @@ h = HASH_OF(*p4); for (i = 0; i < NO_FMTS; i++) { - if (zend_hash_index_find(h, i, (void **) &arg) == SUCCESS - && Z_STRLEN_PP(arg)) { + if (zend_hash_index_find(h, i, (void **) &arg) == SUCCESS) { + convert_to_string_ex(arg); conn->fmt_msgs[i] = strdup(Z_STRVAL_PP(arg)); } else conn->fmt_msgs[i] = NULL; @@ -598,6 +598,7 @@ irc_msg(&conn->conn, Z_STRVAL_PP(recipient), Z_STRVAL_PP(msg)); smart_str_setl(&l, Z_STRVAL_PP(msg), Z_STRLEN_PP(msg)); + smart_str_0(&l); switch (Z_STRVAL_PP(recipient)[0]) { case '#':

« previous php.cvs (#3544) next »