r221: *** empty log message ***
[ctsim.git] / libctsim / imagefile.cpp
index 9df4285a8a35904ee88939647bb6a5428f81a51b..343470a6ecbdb9aaea3c09b1c2101e832b50b592 100644 (file)
@@ -9,7 +9,7 @@
 **  This is part of the CTSim program
 **  Copyright (C) 1983-2000 Kevin Rosenberg
 **
-**  $Id: imagefile.cpp,v 1.11 2000/08/25 15:59:13 kevin Exp $
+**  $Id: imagefile.cpp,v 1.15 2000/11/22 16:39:59 kevin Exp $
 **
 **  This program is free software; you can redistribute it and/or modify
 **  it under the terms of the GNU General Public License (version 2) as
@@ -94,7 +94,8 @@ ImageFile::displayScaling (const int scale, const ImageFileValue pmin, const Ima
 
     delete pPens;
     return (id_X11);
-
+#else
+    return 0;
 #endif
 }
 
@@ -317,7 +318,7 @@ ImageFile::writeImagePGM (const char *outfile, int nxcell, int nycell, double de
     }
     for (int ir = 0; ir < nycell; ir++) {
       for (int ic = 0; ic < nx * nxcell; ic++) 
-       fprintf(fp, "%c ", rowp[ic]);
+       fputc( rowp[ic], fp );
     }
   }
 
@@ -333,8 +334,6 @@ ImageFile::writeImagePGMASCII (const char *outfile, int nxcell, int nycell, doub
   ImageFileArray v = getArray();
 
   unsigned char rowp [nx * nxcell];
-  if (rowp == NULL)
-    return;
 
   if ((fp = fopen (outfile, "wb")) == NULL)
      return;