diff options
Diffstat (limited to 'gdb/xml-support.c')
-rw-r--r-- | gdb/xml-support.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/gdb/xml-support.c b/gdb/xml-support.c index 1f53d7af54c..2b59180c92c 100644 --- a/gdb/xml-support.c +++ b/gdb/xml-support.c @@ -1025,8 +1025,8 @@ xml_fetch_content_from_file (const char *filename, void *baton) gdb::unique_xmalloc_ptr<char> text ((char *) xmalloc (len + 1)); - fread (text.get (), 1, len, file.get ()); - if (ferror (file.get ())) + if (fread (text.get (), 1, len, file.get ()) != len + || ferror (file.get ())) { warning (_("Read error from \"%s\""), filename); return NULL; |