diff options
author | Robin Gareus <robin@gareus.org> | 2017-11-23 10:12:34 +0100 |
---|---|---|
committer | Robin Gareus <robin@gareus.org> | 2017-11-23 10:12:34 +0100 |
commit | 3ac66ce0229e35340c86a64a1ceae949ecb0239a (patch) | |
tree | 1f7742c2ba29f2e4d62aea2a250ab8f14600bc94 /gtk2_ardour/luawindow.cc | |
parent | 4f82d1ba99b204006c17d5622c4d6cf9c566f63d (diff) |
Fix potentially ambiguous printf()
Not a real issue, since it's just supposed to be some unique number.
but still.
Reported by PVS-Studio - https://www.viva64.com/en/b/0540/
Diffstat (limited to 'gtk2_ardour/luawindow.cc')
-rw-r--r-- | gtk2_ardour/luawindow.cc | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/gtk2_ardour/luawindow.cc b/gtk2_ardour/luawindow.cc index 89a1d387aa..4e02cd2b20 100644 --- a/gtk2_ardour/luawindow.cc +++ b/gtk2_ardour/luawindow.cc @@ -483,11 +483,12 @@ LuaWindow::save_script () // 5) construct filename -- TODO ask user for name, ask to replace file. do { + char tme[80]; char buf[80]; time_t t = time(0); struct tm * timeinfo = localtime (&t); - strftime (buf, sizeof(buf), "%s%d", timeinfo); - sprintf (buf, "%s%ld", buf, random ()); // is this valid? + strftime (tme, sizeof(tme), "%s", timeinfo); + snprintf (buf, sizeof(buf), "%s%ld", tme, random ()); MD5 md5; std::string fn = md5.digestString (buf); |