Merge "Cleanup uses of sprintf so we can deprecate it."
am: 2c5b89a64a
* commit '2c5b89a64a6ba2e62299635b8d81a17b59703b4c':
Cleanup uses of sprintf so we can deprecate it.
Cr-Mirrored-From: https://chromium.googlesource.com/aosp/platform/system/core/
Cr-Mirrored-Commit: 3368bdebba02316710bafc5bce120eec388365fb
diff --git a/sync_test.c b/sync_test.c
index ee9ea3c..9a5f7d8 100644
--- a/sync_test.c
+++ b/sync_test.c
@@ -92,7 +92,7 @@
for (j = 0; j < 2; j++) {
unsigned val = i + j * 3 + 1;
- sprintf(str, "test_fence%d-%d", i, j);
+ snprintf(str, sizeof(str), "test_fence%d-%d", i, j);
int fd = sw_sync_fence_create(sync_timeline_fd, str, val);
if (fd < 0) {
printf("can't create sync pt %d: %s", val, strerror(errno));
@@ -106,7 +106,7 @@
sync_data[3].thread_no = 3;
for (j = 0; j < 2; j++) {
- sprintf(str, "merged_fence%d", j);
+ snprintf(str, sizeof(str), "merged_fence%d", j);
sync_data[3].fd[j] = sync_merge(str, sync_data[0].fd[j], sync_data[1].fd[j]);
if (sync_data[3].fd[j] < 0) {
printf("can't merge sync pts %d and %d: %s\n",