Remove usage of sprintf in modules

sprintf is marked as deprecated with Xcode 14.

Bug: chromium:1331345
Change-Id: I834f392bee96e6b6725d5aee469a243dbc6e272e
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/265521
Reviewed-by: Henrik Andreassson <henrika@webrtc.org>
Reviewed-by: Henrik Lundin <henrik.lundin@webrtc.org>
Commit-Queue: Henrik Lundin <henrik.lundin@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#37162}
This commit is contained in:
Byoungchan Lee
2022-06-09 18:14:00 +09:00
committed by WebRTC LUCI CQ
parent 6b0bedb05a
commit 1abcb1106c
4 changed files with 24 additions and 15 deletions

View File

@ -12,6 +12,7 @@
#include <iostream>
#include "rtc_base/strings/string_builder.h"
#include "rtc_base/time_utils.h"
namespace webrtc {
@ -217,9 +218,9 @@ Channel::Channel(int16_t chID)
}
if (chID >= 0) {
_saveBitStream = true;
char bitStreamFileName[500];
sprintf(bitStreamFileName, "bitStream_%d.dat", chID);
_bitStreamFile = fopen(bitStreamFileName, "wb");
rtc::StringBuilder ss;
ss.AppendFormat("bitStream_%d.dat", chID);
_bitStreamFile = fopen(ss.str().c_str(), "wb");
} else {
_saveBitStream = false;
}