File tree Expand file tree Collapse file tree 1 file changed +2
-6
lines changed Expand file tree Collapse file tree 1 file changed +2
-6
lines changed Original file line number Diff line number Diff line change @@ -2538,8 +2538,6 @@ PHP_METHOD(SplFileObject, fseek)
2538
2538
PHP_METHOD (SplFileObject , fgetc )
2539
2539
{
2540
2540
spl_filesystem_object * intern = spl_filesystem_from_obj (Z_OBJ_P (ZEND_THIS ));
2541
- char buf [2 ];
2542
- int result ;
2543
2541
2544
2542
if (zend_parse_parameters_none () == FAILURE ) {
2545
2543
RETURN_THROWS ();
@@ -2549,18 +2547,16 @@ PHP_METHOD(SplFileObject, fgetc)
2549
2547
2550
2548
spl_filesystem_file_free_line (intern );
2551
2549
2552
- result = php_stream_getc (intern -> u .file .stream );
2550
+ int result = php_stream_getc (intern -> u .file .stream );
2553
2551
2554
2552
if (result == EOF ) {
2555
2553
RETURN_FALSE ;
2556
2554
}
2557
2555
if (result == '\n' ) {
2558
2556
intern -> u .file .current_line_num ++ ;
2559
2557
}
2560
- buf [0 ] = result ;
2561
- buf [1 ] = '\0' ;
2562
2558
2563
- RETURN_STRINGL ( buf , 1 );
2559
+ RETURN_STR ( ZSTR_CHAR (( zend_uchar ) result ) );
2564
2560
} /* }}} */
2565
2561
2566
2562
/* {{{ Output all remaining data from a file pointer */
You can’t perform that action at this time.
0 commit comments