forked from premiere/premiere-libtorrent
snprintf fix
This commit is contained in:
parent
c23fda2e2a
commit
970ab50e57
|
@ -142,8 +142,8 @@ namespace libtorrent
|
|||
virtual char const* what() const { return "file renamed"; }
|
||||
virtual std::string message() const
|
||||
{
|
||||
char msg[200];
|
||||
snprintf(msg, 200, "%s: file %d renamed to %s", torrent_alert::message().c_str()
|
||||
char msg[200 + NAME_MAX];
|
||||
snprintf(msg, sizeof(msg), "%s: file %d renamed to %s", torrent_alert::message().c_str()
|
||||
, index, name.c_str());
|
||||
return msg;
|
||||
}
|
||||
|
@ -168,8 +168,8 @@ namespace libtorrent
|
|||
virtual char const* what() const { return "file rename failed"; }
|
||||
virtual std::string message() const
|
||||
{
|
||||
char ret[200];
|
||||
snprintf(ret, 200, "%s: failed to rename file %d: %s"
|
||||
char ret[200 + NAME_MAX];
|
||||
snprintf(ret, sizeof(msg), "%s: failed to rename file %d: %s"
|
||||
, torrent_alert::message().c_str(), index, msg.c_str());
|
||||
return ret;
|
||||
}
|
||||
|
|
|
@ -102,7 +102,7 @@ POSSIBILITY OF SUCH DAMAGE.
|
|||
// this is the maximum number of characters in a
|
||||
// path element / filename on windows
|
||||
#define NAME_MAX 255
|
||||
#define snprintf _snprintf_s
|
||||
#define snprintf _snprintf
|
||||
#define strtoll _strtoi64
|
||||
#endif
|
||||
|
||||
|
|
Loading…
Reference in New Issue