X-Git-Url: http://git.kpe.io/?a=blobdiff_plain;f=libctsim%2Farray2dfile.cpp;h=2999470e871e85af572312a63f941e796ab9ae0a;hb=806adf54f5b8d061662696b3b498bfab3cd8b2e6;hp=f918471f54e7278a5789f5095efddaae9f091231;hpb=baba40afccf75bd75d612980fee023ff22c40952;p=ctsim.git diff --git a/libctsim/array2dfile.cpp b/libctsim/array2dfile.cpp index f918471..2999470 100644 --- a/libctsim/array2dfile.cpp +++ b/libctsim/array2dfile.cpp @@ -9,7 +9,7 @@ ** This is part of the CTSim program ** Copyright (C) 1983-2000 Kevin Rosenberg ** -** $Id: array2dfile.cpp,v 1.13 2000/12/04 04:15:48 kevin Exp $ +** $Id: array2dfile.cpp,v 1.14 2000/12/04 19:50:57 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 @@ -278,7 +278,11 @@ Array2dFile::fileRead (const char* const filename) { m_filename = filename; - frnetorderstream fs (m_filename.c_str(), ios::out | ios::in | ios::binary | ios::nocreate); +#ifdef MSVC + frnetorderstream fs (m_filename.c_str(), ios::out | ios::in | ios::binary); +#else + frnetorderstream fs (m_filename.c_str(), ios::out | ios::in | ios::binary | ios::nocreate); +#endif if (fs.fail()) { sys_error (ERR_WARNING, "Unable to open file %s [fileRead]", m_filename.c_str()); return false; @@ -476,13 +480,15 @@ Array2dFile::labelsRead (frnetorderstream& fs) kuint16 strLength; fs.readInt16 (strLength); - char labelStr [strLength+1]; + char* labelStr = new char [strLength+1]; fs.read (labelStr, strLength); labelStr[strLength] = 0; Array2dFileLabel* pLabel = new Array2dFileLabel(labelType, labelStr, calcTime); + delete labelStr; + pLabel->setDateTime (year, month, day, hour, minute, second); - m_labels.push_back (pLabel); + m_labels.push_back (pLabel); } return true;