diff options
author | Wez Furlong <wez@php.net> | 2002-10-19 13:11:48 +0000 |
---|---|---|
committer | Wez Furlong <wez@php.net> | 2002-10-19 13:11:48 +0000 |
commit | 829f1855fdc70b2db862f400423327b75de0bdf1 (patch) | |
tree | 0596c78c4425d717f0a15fb3b925a0d029a80860 /main/php_streams.h | |
parent | 8998bce403f1f9e91e043a4fa9b18c0a70248978 (diff) | |
download | php-git-829f1855fdc70b2db862f400423327b75de0bdf1.tar.gz |
made fgets() binary safe.
php_stream_gets is now a macro which calls php_stream_get_line. The latter
has an option argument to return the number of bytes in the line.
Functions like fgetcsv(), fgetss() can be made binary safe by calling
php_stream_get_line directly.
# HEADS UP: You will need to make clean after updating your CVS, as the
# binary signature has changed.
Diffstat (limited to 'main/php_streams.h')
-rwxr-xr-x | main/php_streams.h | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/main/php_streams.h b/main/php_streams.h index 0f85166ef6..6861671360 100755 --- a/main/php_streams.h +++ b/main/php_streams.h @@ -359,8 +359,10 @@ PHPAPI int _php_stream_putc(php_stream *stream, int c TSRMLS_DC); PHPAPI int _php_stream_flush(php_stream *stream, int closing TSRMLS_DC); #define php_stream_flush(stream) _php_stream_flush((stream), 0 TSRMLS_CC) -PHPAPI char *_php_stream_gets(php_stream *stream, char *buf, size_t maxlen TSRMLS_DC); -#define php_stream_gets(stream, buf, maxlen) _php_stream_gets((stream), (buf), (maxlen) TSRMLS_CC) +PHPAPI char *_php_stream_get_line(php_stream *stream, char *buf, size_t maxlen, size_t *returned_len TSRMLS_DC); +#define php_stream_gets(stream, buf, maxlen) _php_stream_get_line((stream), (buf), (maxlen), NULL TSRMLS_CC) + +#define php_stream_get_line(stream, buf, maxlen, retlen) _php_stream_get_line((stream), (buf), (maxlen), (retlen) TSRMLS_CC) /* CAREFUL! this is equivalent to puts NOT fputs! */ PHPAPI int _php_stream_puts(php_stream *stream, char *buf TSRMLS_DC); |