diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2013-11-05 10:17:22 -0500 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2013-11-05 10:17:22 -0500 |
commit | 7aa46da32f880ad4c7ced29fcea27e002a2c2321 (patch) | |
tree | 5bd5b1ee40650ee6c32669a1beee6ab3eee91e6b /libs | |
parent | 3e661d97b57047144336253f79d679a7300aead8 (diff) |
fix incorrect use of sizeof() in snprintf (function never actually used in ardour,but ... )
Diffstat (limited to 'libs')
-rw-r--r-- | libs/ardour/ardour/session.h | 2 | ||||
-rw-r--r-- | libs/ardour/session_time.cc | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/libs/ardour/ardour/session.h b/libs/ardour/ardour/session.h index 02e883ed11..9b4fbef774 100644 --- a/libs/ardour/ardour/session.h +++ b/libs/ardour/ardour/session.h @@ -504,7 +504,7 @@ class Session : public PBD::StatefulDestructible, public PBD::ScopedConnectionLi void timecode_time_subframes (framepos_t when, Timecode::Time&); void timecode_duration (framecnt_t, Timecode::Time&) const; - void timecode_duration_string (char *, framecnt_t) const; + void timecode_duration_string (char *, size_t len, framecnt_t) const; framecnt_t convert_to_frames (AnyTime const & position); framecnt_t any_duration_to_frames (framepos_t position, AnyTime const & duration); diff --git a/libs/ardour/session_time.cc b/libs/ardour/session_time.cc index e35910f2df..ab5a470a8a 100644 --- a/libs/ardour/session_time.cc +++ b/libs/ardour/session_time.cc @@ -164,12 +164,12 @@ Session::timecode_duration (framecnt_t when, Timecode::Time& timecode) const } void -Session::timecode_duration_string (char* buf, framepos_t when) const +Session::timecode_duration_string (char* buf, size_t len, framepos_t when) const { Timecode::Time timecode; timecode_duration (when, timecode); - snprintf (buf, sizeof (buf), "%02" PRIu32 ":%02" PRIu32 ":%02" PRIu32 ":%02" PRIu32, timecode.hours, timecode.minutes, timecode.seconds, timecode.frames); + snprintf (buf, len, "%02" PRIu32 ":%02" PRIu32 ":%02" PRIu32 ":%02" PRIu32, timecode.hours, timecode.minutes, timecode.seconds, timecode.frames); } void |