]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
libstdc++: Fix fwrite error parameter
authorTianqiang Shuai <1101282468@qq.com>
Wed, 5 Jul 2023 16:07:51 +0000 (17:07 +0100)
committerJonathan Wakely <jwakely@redhat.com>
Thu, 6 Jul 2023 20:41:44 +0000 (21:41 +0100)
The first parameter of fwrite should be the const char* __s which want
write to FILE *__file, rather than the FILE *__file write to the FILE
*__file.

libstdc++-v3/ChangeLog:

* config/io/basic_file_stdio.cc (xwrite) [USE_STDIO_PURE]: Fix
first argument.

libstdc++-v3/config/io/basic_file_stdio.cc

index 5501fbdd6955c8660947188b63834aa82e7744fe..7de9d98c3c7e8e8773697e0dc49ab650bdd1fa56 100644 (file)
@@ -128,7 +128,7 @@ namespace
     for (;;)
       {
 #ifdef _GLIBCXX_USE_STDIO_PURE
-       const std::streamsize __ret = fwrite(__file, 1, __nleft, __file);
+       const std::streamsize __ret = fwrite(__s, 1, __nleft, __file);
 #else
        const std::streamsize __ret = write(__fd, __s, __nleft);
 #endif