socketd=*(int*)what;
}
- buf = emalloc(sizeof(char) * 2);
- if (!(*buf = FP_FGETC(socketd, (FILE*)what, issock))) {
+ buf = emalloc(sizeof(int));
+ if ((*buf = FP_FGETC(socketd, (FILE*)what, issock)) == EOF) {
efree(buf);
RETVAL_FALSE;
} else {
{
pval **arg1;
void *what;
+ long ret;
if (ARG_COUNT(ht) != 1 || zend_get_parameters_ex(1, &arg1) == FAILURE) {
WRONG_PARAM_COUNT;
what = zend_fetch_resource(arg1,-1,"File-Handle",NULL,2,le_fopen,le_popen);
ZEND_VERIFY_RESOURCE(what);
+
+ ret = ftell((FILE*) what);
+ if(ret == -1) {
+ RETURN_FALSE;
+ }
- RETURN_LONG(ftell((FILE*) what));
+ RETURN_LONG(ret);
}
/* }}} */