summaryrefslogtreecommitdiffstats
path: root/arts/runtime
diff options
context:
space:
mode:
authorOBATA Akio <obache@wizdas.com>2019-04-09 18:49:43 +0900
committerTDE Gitea <gitea@mirror.git.trinitydesktop.org>2019-04-11 15:47:12 +0000
commit9b8b7c129917f2813e5f412fe08b6a153ca05981 (patch)
tree41bf39dc8ddf808fc5b97287dd946353603eaf35 /arts/runtime
parenta2b21b9cf6125f091d83cd99c91d57fa77f1c917 (diff)
downloadtdemultimedia-9b8b7c129917f2813e5f412fe08b6a153ca05981.tar.gz
tdemultimedia-9b8b7c129917f2813e5f412fe08b6a153ca05981.zip
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 <obache@wizdas.com>
Diffstat (limited to 'arts/runtime')
-rw-r--r--arts/runtime/artsbuilderloader_impl.cc2
1 files changed, 1 insertions, 1 deletions
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