Skip to content

Commit 534ee96

Browse files
committed
fix ftell/fseek calls
1 parent 5cf17fc commit 534ee96

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

sapi/cli/php_cli.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -627,8 +627,8 @@ static int cli_seek_file_begin(zend_file_handle *file_handle, char *script_file,
627627
/* handle situations where line is terminated by \r\n */
628628
if (c == '\r') {
629629
if (fgetc(file_handle->handle.fp) != '\n') {
630-
long pos = ftell(file_handle->handle.fp);
631-
fseek(file_handle->handle.fp, pos - 1, SEEK_SET);
630+
zend_long pos = zend_ftell(file_handle->handle.fp);
631+
zend_fseek(file_handle->handle.fp, pos - 1, SEEK_SET);
632632
}
633633
}
634634
*lineno = 2;

0 commit comments

Comments
 (0)