From b1f6c161d15b82bdf20d1b6ca45529826bda686c Mon Sep 17 00:00:00 2001 From: Zorg Date: Sat, 25 Jun 2022 16:41:32 -0700 Subject: [PATCH] Use snprintf instead of sprintf to fix compile warning (#2179) --- Autoupdate/SUBinaryDeltaCommon.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Autoupdate/SUBinaryDeltaCommon.m b/Autoupdate/SUBinaryDeltaCommon.m index 6e3bffdf..3987fd84 100644 --- a/Autoupdate/SUBinaryDeltaCommon.m +++ b/Autoupdate/SUBinaryDeltaCommon.m @@ -329,7 +329,7 @@ NSString *displayHashFromRawHash(const unsigned char *hash) { char hexHash[CC_SHA1_DIGEST_LENGTH * 2 + 1] = {0}; for (size_t i = 0; i < CC_SHA1_DIGEST_LENGTH; i++) { - sprintf(hexHash + i * 2, "%02x", hash[i]); + snprintf(hexHash + i * 2, 3, "%02x", hash[i]); } return @(hexHash); }