diff options
Diffstat (limited to 'gl/stdio-read.c')
| -rw-r--r-- | gl/stdio-read.c | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/gl/stdio-read.c b/gl/stdio-read.c index 70452b48..0ca956dc 100644 --- a/gl/stdio-read.c +++ b/gl/stdio-read.c | |||
| @@ -1,5 +1,5 @@ | |||
| 1 | /* POSIX compatible FILE stream read function. | 1 | /* POSIX compatible FILE stream read function. |
| 2 | Copyright (C) 2008-2025 Free Software Foundation, Inc. | 2 | Copyright (C) 2008-2026 Free Software Foundation, Inc. |
| 3 | Written by Bruno Haible <bruno@clisp.org>, 2011. | 3 | Written by Bruno Haible <bruno@clisp.org>, 2011. |
| 4 | 4 | ||
| 5 | This file is free software: you can redistribute it and/or modify | 5 | This file is free software: you can redistribute it and/or modify |
| @@ -52,9 +52,8 @@ | |||
| 52 | return (EXPRESSION); \ | 52 | return (EXPRESSION); \ |
| 53 | else \ | 53 | else \ |
| 54 | { \ | 54 | { \ |
| 55 | RETTYPE ret; \ | ||
| 56 | SetLastError (0); \ | 55 | SetLastError (0); \ |
| 57 | ret = (EXPRESSION); \ | 56 | RETTYPE ret = (EXPRESSION); \ |
| 58 | if (FAILED) \ | 57 | if (FAILED) \ |
| 59 | { \ | 58 | { \ |
| 60 | if (GetLastError () == ERROR_NO_DATA && ferror (stream)) \ | 59 | if (GetLastError () == ERROR_NO_DATA && ferror (stream)) \ |
| @@ -86,11 +85,9 @@ | |||
| 86 | int | 85 | int |
| 87 | scanf (const char *format, ...) | 86 | scanf (const char *format, ...) |
| 88 | { | 87 | { |
| 89 | int retval; | ||
| 90 | va_list args; | 88 | va_list args; |
| 91 | |||
| 92 | va_start (args, format); | 89 | va_start (args, format); |
| 93 | retval = vfscanf (stdin, format, args); | 90 | int retval = vfscanf (stdin, format, args); |
| 94 | va_end (args); | 91 | va_end (args); |
| 95 | 92 | ||
| 96 | return retval; | 93 | return retval; |
| @@ -103,11 +100,9 @@ scanf (const char *format, ...) | |||
| 103 | int | 100 | int |
| 104 | fscanf (FILE *stream, const char *format, ...) | 101 | fscanf (FILE *stream, const char *format, ...) |
| 105 | { | 102 | { |
| 106 | int retval; | ||
| 107 | va_list args; | 103 | va_list args; |
| 108 | |||
| 109 | va_start (args, format); | 104 | va_start (args, format); |
| 110 | retval = vfscanf (stream, format, args); | 105 | int retval = vfscanf (stream, format, args); |
| 111 | va_end (args); | 106 | va_end (args); |
| 112 | 107 | ||
| 113 | return retval; | 108 | return retval; |
