From 1a748ff2826847c36e3b4859898447cac55b11d6 Mon Sep 17 00:00:00 2001 From: deva Date: Thu, 27 Jan 2011 10:43:05 +0000 Subject: Remove stupid newline from end of ctime output. --- server/src/macrotool/export.cc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/server/src/macrotool/export.cc b/server/src/macrotool/export.cc index 150a85c..c9dcbd1 100644 --- a/server/src/macrotool/export.cc +++ b/server/src/macrotool/export.cc @@ -217,7 +217,10 @@ static void export_prefix(std::string prefix) files[templ]->addcell("patientid", patientid); files[templ]->addcell("template", templ); time_t t = atol(timestamp.c_str()); - files[templ]->addcell("time", ctime(&t)); + std::string timestr = ctime(&t); + if(timestr[timestr.size() - 1] == '\n') + timestr = timestr.substr(0, timestr.size() - 1); + files[templ]->addcell("time", timestr.c_str()); printf("%s %s %s\n", timestamp.c_str(), patientid.c_str(), templ.c_str()); -- cgit v1.2.3