Skip to content

Commit 950f75d

Browse files
committed
test: Don't use sprintf, use snprintf instead
Current Xcode versions warn about sprintf being deprecated.
1 parent 5c26c68 commit 950f75d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

test/api/simple_test.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ int main (int argc, char** argv) {
1313

1414
#if (defined(ANDROID_NDK)||defined(APPLE_IOS)||defined(WINDOWS_PHONE))
1515
char xmlPath[1024] = "";
16-
sprintf (xmlPath, "xml:%s", argv[1]);
16+
snprintf (xmlPath, sizeof(xmlPath), "xml:%s", argv[1]);
1717
::testing::GTEST_FLAG (output) = xmlPath;
1818
#endif
1919
::testing::InitGoogleTest (&argc, argv);

0 commit comments

Comments
 (0)