diff options
author | George Burgess IV | 2016-03-02 16:02:55 -0600 |
---|---|---|
committer | George Burgess IV | 2016-03-07 20:40:40 -0600 |
commit | e7aa2b2c8378b458345477d1f6d9904490263bb6 (patch) | |
tree | 125b6116858579422945357b40930b5738a94eab /libsync | |
parent | d1ec9c450d8dc9d24b5f0254111449ecfcbeaea6 (diff) | |
download | platform-system-core-e7aa2b2c8378b458345477d1f6d9904490263bb6.tar.gz platform-system-core-e7aa2b2c8378b458345477d1f6d9904490263bb6.tar.xz platform-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))) | |||
92 | 92 | ||
93 | for (j = 0; j < 2; j++) { | 93 | for (j = 0; j < 2; j++) { |
94 | unsigned val = i + j * 3 + 1; | 94 | unsigned val = i + j * 3 + 1; |
95 | sprintf(str, "test_fence%d-%d", i, j); | 95 | snprintf(str, sizeof(str), "test_fence%d-%d", i, j); |
96 | int fd = sw_sync_fence_create(sync_timeline_fd, str, val); | 96 | int fd = sw_sync_fence_create(sync_timeline_fd, str, val); |
97 | if (fd < 0) { | 97 | if (fd < 0) { |
98 | printf("can't create sync pt %d: %s", val, strerror(errno)); | 98 | 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))) | |||
106 | 106 | ||
107 | sync_data[3].thread_no = 3; | 107 | sync_data[3].thread_no = 3; |
108 | for (j = 0; j < 2; j++) { | 108 | for (j = 0; j < 2; j++) { |
109 | sprintf(str, "merged_fence%d", j); | 109 | snprintf(str, sizeof(str), "merged_fence%d", j); |
110 | sync_data[3].fd[j] = sync_merge(str, sync_data[0].fd[j], sync_data[1].fd[j]); | 110 | sync_data[3].fd[j] = sync_merge(str, sync_data[0].fd[j], sync_data[1].fd[j]); |
111 | if (sync_data[3].fd[j] < 0) { | 111 | if (sync_data[3].fd[j] < 0) { |
112 | printf("can't merge sync pts %d and %d: %s\n", | 112 | printf("can't merge sync pts %d and %d: %s\n", |