Skip to content
Snippets Groups Projects
Commit b9d9a84f authored by Nat Goodspeed's avatar Nat Goodspeed
Browse files

Fix test failure due to erroneous validation of fputs() return value.

parent 8c2026d6
No related branches found
No related tags found
No related merge requests found
...@@ -263,7 +263,9 @@ namespace tut ...@@ -263,7 +263,9 @@ namespace tut
std::string path = dir + delim + file; std::string path = dir + delim + file;
LLFILE* handle = LLFile::fopen( path, "w" ); LLFILE* handle = LLFile::fopen( path, "w" );
ensure("failed to open test file '"+path+"'", handle != NULL ); ensure("failed to open test file '"+path+"'", handle != NULL );
ensure("failed to write to test file '"+path+"'", !fputs("test file", handle) ); // Harbison & Steele, 4th ed., p. 366: "If an error occurs, fputs
// returns EOF; otherwise, it returns some other, nonnegative value."
ensure("failed to write to test file '"+path+"'", fputs("test file", handle) >= 0);
fclose(handle); fclose(handle);
return path; return path;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment