X-Git-Url: http://git.kpe.io/?a=blobdiff_plain;f=libctsim%2Fprojections.cpp;h=7de82039d629517652649bf741ede6ae4a5f454b;hb=4114001db83630028afd31d215df560f8d682b22;hp=fb24e0d897bf065d9d348a5b09f827eacf1b8b8d;hpb=bfcc769cf8019eabc8c65c07257c8dbee4b4c977;p=ctsim.git diff --git a/libctsim/projections.cpp b/libctsim/projections.cpp index fb24e0d..7de8203 100644 --- a/libctsim/projections.cpp +++ b/libctsim/projections.cpp @@ -8,7 +8,7 @@ ** This is part of the CTSim program ** Copyright (C) 1983-2000 Kevin Rosenberg ** -** $Id: projections.cpp,v 1.25 2000/09/02 05:10:39 kevin Exp $ +** $Id: projections.cpp,v 1.28 2000/12/06 01:46:43 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 @@ -25,7 +25,8 @@ ******************************************************************************/ #include "ct.h" - + +const kuint16 Projections::m_signature = ('P'*256 + 'J'); /* NAME * Projections Constructor for projections matrix storage @@ -253,14 +254,15 @@ Projections::headerRead (fnetorderstream& fs) return false; } - char remarkStorage[_remarksize+1]; - fs.read (remarkStorage, _remarksize); + char* pszRemarkStorage = new char [_remarksize+1]; + fs.read (pszRemarkStorage, _remarksize); if (! fs) { sys_error (ERR_SEVERE, "Error reading remark, _remarksize = %d", _remarksize); return false; } - remarkStorage[_remarksize] = 0; - m_remark = remarkStorage; + pszRemarkStorage[_remarksize] = 0; + m_remark = pszRemarkStorage; + delete pszRemarkStorage; off_t _hsizeread = fs.tellg(); if (!fs || _hsizeread != _hsize) { @@ -343,6 +345,7 @@ Projections::write (const char* filename) return false; } +#ifdef HAVE_TIME time_t t = time(NULL); tm* lt = localtime(&t); m_year = lt->tm_year; @@ -351,6 +354,7 @@ Projections::write (const char* filename) m_hour = lt->tm_hour; m_minute = lt->tm_min; m_second = lt->tm_sec; +#endif if (! headerWrite (fs)) return false;