cvs: php4 /ext/standard file.c

From: Date: Wed, 27 Sep 2000 16:08:27 +0000
Subject: cvs: php4 /ext/standard file.c
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-1845@lists.php.net to get a copy of this message
sas Wed Sep 27 09:08:27 2000 EDT Modified files: /php4/ext/standard file.c Log: Automatic conversion might cause interpretation of 0xff as EOF, so we store the result in an object of type int first. Submitted by: melchers@cis.fu-berlin.de Index: php4/ext/standard/file.c diff -u php4/ext/standard/file.c:1.115 php4/ext/standard/file.c:1.116 --- php4/ext/standard/file.c:1.115 Mon Sep 11 21:13:21 2000 +++ php4/ext/standard/file.c Wed Sep 27 09:08:26 2000 @@ -20,7 +20,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: file.c,v 1.115 2000/09/12 04:13:21 andi Exp $ */ +/* $Id: file.c,v 1.116 2000/09/27 16:08:26 sas Exp $ */ /* Synced with php 3.0 revision 1.218 1999-06-16 [ssb] */ @@ -908,6 +908,7 @@ int issock=0; int socketd=0; void *what; + int result; if (ARG_COUNT(ht) != 1 || zend_get_parameters_ex(1, &arg1) == FAILURE) { WRONG_PARAM_COUNT; @@ -922,10 +923,11 @@ } buf = emalloc(sizeof(int)); - if ((*buf = FP_FGETC(socketd, (FILE*)what, issock)) == EOF) { + if ((result = FP_FGETC(socketd, (FILE*)what, issock)) == EOF) { efree(buf); RETVAL_FALSE; } else { + buf[0]=result; buf[1]='\0'; return_value->value.str.val = buf; return_value->value.str.len = 1;

« previous php.cvs (#1845) next »