From 9b8b7c129917f2813e5f412fe08b6a153ca05981 Mon Sep 17 00:00:00 2001 From: OBATA Akio Date: Tue, 9 Apr 2019 18:49:43 +0900 Subject: Fix for time_t != long `time_t` may not be `long`, for examples, unsigned (long) int, long long int (64bit integer type on 32bit arch), double, and so on. Change to use difftime(3) to retrieve seconds. Signed-off-by: OBATA Akio --- arts/runtime/artsbuilderloader_impl.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'arts') diff --git a/arts/runtime/artsbuilderloader_impl.cc b/arts/runtime/artsbuilderloader_impl.cc index ee009417..238daae2 100644 --- a/arts/runtime/artsbuilderloader_impl.cc +++ b/arts/runtime/artsbuilderloader_impl.cc @@ -247,7 +247,7 @@ public: if( stat(filename.c_str(), &st) == 0 ) { char mtime[32]; - sprintf(mtime,"[%ld]",st.st_mtime); + snprintf(mtime,sizeof(mtime),"[%.0f]",difftime(st.st_mtime, (time_t)0)); result += filename + mtime; } else -- cgit v1.2.3