From 7146cf8ee65d35dcc8b1bfa55bc7b25b3ca73d2d Mon Sep 17 00:00:00 2001 From: erihel Date: Mon, 8 Apr 2013 12:58:00 +0200 Subject: * Issue #60: Fix for "(null)" instead of time on windows platform --- src/ui/studio.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/ui/studio.cpp b/src/ui/studio.cpp index 29dfebf..3010d5a 100644 --- a/src/ui/studio.cpp +++ b/src/ui/studio.cpp @@ -1511,8 +1511,8 @@ void CStudio::UpdateDialogList() fs::path path; int i = 0; char time[100]; - char temp[100]; - + std::ostringstream temp; + pw = static_cast< CWindow* >(m_interface->SearchControl(EVENT_WINDOW9)); if ( pw == nullptr ) return; pl = static_cast< CList* >(pw->SearchControl(EVENT_DIALOG_LIST)); @@ -1525,9 +1525,8 @@ void CStudio::UpdateDialogList() for( fs::directory_iterator file(path); file != end_iter; file++) { if (fs::is_regular_file(file->status()) ) { TimeToAscii(fs::last_write_time(file->path()), time); - sprintf(temp, "%s\t%lu \t%s", file->path().filename().string().c_str(), fs::file_size(file->path()), time); - - pl->SetName(i++, temp); + temp << file->path().filename().string() << '\t' << fs::file_size(file->path()) << " \t" << time; + pl->SetName(i++, temp.str().c_str()); } } } -- cgit v1.2.3-1-g7c22