From 45d66a59d6dc65a228fee7df6dc8290de694481f Mon Sep 17 00:00:00 2001 From: Justin Cohen Date: Mon, 6 Jun 2022 22:51:50 -0400 Subject: [PATCH] Fix usage of sprintf. sprintf is marked as deprecated with Xcode 14. Bug: chromium:1331345 Change-Id: Ib7eb7ab829457f3ef5fcad44b43fe827359ad7d4 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/265200 Commit-Queue: Harald Alvestrand Reviewed-by: Harald Alvestrand Auto-Submit: Justin Cohen Reviewed-by: Mirko Bonadei Cr-Commit-Position: refs/heads/main@{#37136} --- rtc_base/http_common.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rtc_base/http_common.cc b/rtc_base/http_common.cc index 2968cf12c3..621b854b53 100644 --- a/rtc_base/http_common.cc +++ b/rtc_base/http_common.cc @@ -305,7 +305,7 @@ HttpAuthResult HttpAuthenticate(absl::string_view challenge, std::string cnonce, ncount; char buffer[256]; - sprintf(buffer, "%d", static_cast(time(0))); + snprintf(buffer, sizeof(buffer), "%d", static_cast(time(0))); cnonce = MD5(buffer); ncount = "00000001";