diff options
author | George Burgess IV <gbiv@google.com> | 2016-03-02 14:02:55 -0800 |
---|---|---|
committer | George Burgess IV <gbiv@google.com> | 2016-03-07 18:40:40 -0800 |
commit | e7aa2b2c8378b458345477d1f6d9904490263bb6 (patch) | |
tree | 125b6116858579422945357b40930b5738a94eab /libsync | |
parent | d1ec9c450d8dc9d24b5f0254111449ecfcbeaea6 (diff) | |
download | system_core-e7aa2b2c8378b458345477d1f6d9904490263bb6.tar.gz system_core-e7aa2b2c8378b458345477d1f6d9904490263bb6.tar.bz2 system_core-e7aa2b2c8378b458345477d1f6d9904490263bb6.zip |
Cleanup uses of sprintf so we can deprecate it.
Also cleans up two instances of open() with useless mode params, and
changes a few uses of snprintf to use sizeof(buffer) instead of
hardcoded buffer sizes.
Change-Id: If11591003d910c995e72ad8f75afd072c255a3c5
Diffstat (limited to 'libsync')
-rw-r--r-- | libsync/sync_test.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/libsync/sync_test.c b/libsync/sync_test.c index ee9ea3ca1..9a5f7d858 100644 --- a/libsync/sync_test.c +++ b/libsync/sync_test.c @@ -92,7 +92,7 @@ int main(int argc __attribute__((unused)), char *argv[] __attribute__((unused))) 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 @@ int main(int argc __attribute__((unused)), char *argv[] __attribute__((unused))) 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", |