1. simon_linden
  2. viewer-rabbit

Commits

nat_linden  committed 2506e11 Merge
  • Participants
  • Parent commits 1d7367f, 01c345e
  • Branches default

Comments (0)

Files changed (1)

File indra/llvfs/tests/lldir_test.cpp

View file
  • Ignore whitespace
       std::string path = dir + delim + file;
       LLFILE* handle = LLFile::fopen( path, "w" );
       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);
       return path;
    }