]> granicus.if.org Git - php/commitdiff
fix ftell/fseek calls
authorAnatol Belski <ab@php.net>
Sun, 14 Sep 2014 21:03:13 +0000 (23:03 +0200)
committerAnatol Belski <ab@php.net>
Sun, 14 Sep 2014 21:03:13 +0000 (23:03 +0200)
sapi/cli/php_cli.c

index 2e714c4a90b381fdec55d0f287ed83ff84997e62..f3eec8028390070360a0951f6159c69ea9f6a226 100644 (file)
@@ -627,8 +627,8 @@ static int cli_seek_file_begin(zend_file_handle *file_handle, char *script_file,
                /* handle situations where line is terminated by \r\n */
                if (c == '\r') {
                        if (fgetc(file_handle->handle.fp) != '\n') {
-                               long pos = ftell(file_handle->handle.fp);
-                               fseek(file_handle->handle.fp, pos - 1, SEEK_SET);
+                               zend_long pos = zend_ftell(file_handle->handle.fp);
+                               zend_fseek(file_handle->handle.fp, pos - 1, SEEK_SET);
                        }
                }
                *lineno = 2;