Browse Source

fix win32 bug

David Rose 17 years ago
parent
commit
a99736ede9
1 changed files with 7 additions and 1 deletions
  1. 7 1
      dtool/src/dtoolutil/pandaFileStreamBuf.cxx

+ 7 - 1
dtool/src/dtoolutil/pandaFileStreamBuf.cxx

@@ -518,7 +518,13 @@ write_chars(const char *start, size_t length) {
   char *buffer = (char *)alloca(buffer_length);
 
   size_t write_length = encode_newlines(buffer, buffer_length, start, length);
-  return write_chars_raw(buffer, write_length);
+  if (write_length == write_chars_raw(buffer, write_length)) {
+    // Success.  Return the number of original characters.
+    return length;
+  }
+
+  // Error.  Pretend we wrote nothing.
+  return 0;
 }
 
 ////////////////////////////////////////////////////////////////////