CVS update: php3/functions
| From: | sas | Date: | Fri, 09 Apr 1999 09:26:41 +0000 |
| Subject: | CVS update: php3/functions | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-4999@lists.php.net to get a copy of this message | ||
Date: Friday April 9, 1999 @ 5:26
Author: sas
Update of /repository/php3/functions
In directory asf:/u/temp/cvs-serv23011/functions
Modified Files:
dba_cdb.c
Log Message:
return "real" C "strings"
Index: php3/functions/dba_cdb.c
diff -c php3/functions/dba_cdb.c:1.2 php3/functions/dba_cdb.c:1.3
*** php3/functions/dba_cdb.c:1.2 Fri Apr 9 05:06:33 1999
--- php3/functions/dba_cdb.c Fri Apr 9 05:26:41 1999
***************
*** 27,33 ****
+----------------------------------------------------------------------+
*/
! /* $Id: dba_cdb.c,v 1.2 1999/04/09 09:06:33 sas Exp $ */
#include "php.h"
--- 27,33 ----
+----------------------------------------------------------------------+
*/
! /* $Id: dba_cdb.c,v 1.3 1999/04/09 09:26:41 sas Exp $ */
#include "php.h"
***************
*** 143,150 ****
CREAD(8);
len = cdb_unpack(buf);
! key = emalloc(len);
! read(cdb->fd, key, len);
/* header + klenlen + dlenlen + klen + dlen */
cdb->pos = 2048 + 4 + 4 + len + cdb_unpack(buf + 4);
--- 143,154 ----
CREAD(8);
len = cdb_unpack(buf);
! key = emalloc(len + 1);
! if(read(cdb->fd, key, len) < len) {
! efree(key);
! key = NULL;
! } else
! key[len] = '\0';
/* header + klenlen + dlenlen + klen + dlen */
cdb->pos = 2048 + 4 + 4 + len + cdb_unpack(buf + 4);
***************
*** 164,174 ****
CREAD(8);
len = cdb_unpack(buf);
! nkey = emalloc(len);
if(read(cdb->fd, nkey, len) < len) {
efree(nkey);
return NULL;
}
cdb->pos += 8 + len + cdb_unpack(buf + 4);
--- 168,179 ----
CREAD(8);
len = cdb_unpack(buf);
! nkey = emalloc(len + 1);
if(read(cdb->fd, nkey, len) < len) {
efree(nkey);
return NULL;
}
+ nkey[len] = '\0';
cdb->pos += 8 + len + cdb_unpack(buf + 4);
***************
*** 186,196 ****
CREAD(8);
len = cdb_unpack(buf);
! nkey = emalloc(len);
if(read(cdb->fd, nkey, len) < len) {
efree(nkey);
nkey = NULL;
! }
}
return nkey;
#endif
--- 191,202 ----
CREAD(8);
len = cdb_unpack(buf);
! nkey = emalloc(len + 1);
if(read(cdb->fd, nkey, len) < len) {
efree(nkey);
nkey = NULL;
! } else
! nkey[len] = '\0';
}
return nkey;
#endif
--
PHP Development Mailing List http://www.php.net/
To unsubscribe send an empty message to php-dev-unsubscribe@lists.php.net
For help: php-dev-help@lists.php.net