Code

FIX 407115 test writing into file and throw exception upstream if needed
authortheAdib <theAdib@users.sourceforge.net>
Sun, 2 Aug 2009 15:04:57 +0000 (15:04 +0000)
committertheAdib <theAdib@users.sourceforge.net>
Sun, 2 Aug 2009 15:04:57 +0000 (15:04 +0000)
src/io/uristream.cpp

index f529c7f8bc19de009581298a2842c9d6a9695fd6..05d7f020af8d1e2066d388f795357eb1b4c98d8f 100644 (file)
@@ -429,7 +429,10 @@ void UriOutputStream::put(int ch) throw(StreamException)
             if (!outf)
                 return;
             uch = (unsigned char)(ch & 0xff);
-            fputc(uch, outf);
+            if (fputc(uch, outf) == EOF) {
+                Glib::ustring err = "ERROR writing to file ";
+                throw StreamException(err);
+            }
             //fwrite(uch, 1, 1, outf);
         break;