diff options
author | Treehugger Robot <treehugger-gerrit@google.com> | 2018-01-11 20:52:26 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2018-01-11 20:52:26 +0000 |
commit | b3332a0aef38410330e6cd792c3e47aeddac715e (patch) | |
tree | cdf2a7b42b2f307dcc4682582426582d2ba7bb86 | |
parent | fd2465da5e918ac683c98dc2369408bed271e86e (diff) | |
parent | a1902c0d74c8fa8d1ab815491d96e676e203dcc8 (diff) | |
download | tinyalsa-b3332a0aef38410330e6cd792c3e47aeddac715e.tar.gz |
Merge "tinyalsa: Fix debug info data type mismatch error and potential risk of wild pointer"android-wear-8.0.0_r1android-p-preview-1android-o-mr1-iot-preview-7o-mr1-iot-preview-7
-rw-r--r-- | tinycap.c | 7 | ||||
-rw-r--r-- | tinymix.c | 4 | ||||
-rw-r--r-- | tinypcminfo.c | 2 |
3 files changed, 7 insertions, 6 deletions
@@ -157,7 +157,8 @@ int main(int argc, char **argv) format = PCM_FORMAT_S16_LE; break; default: - fprintf(stderr, "%d bits is not supported.\n", bits); + fprintf(stderr, "%u bits is not supported.\n", bits); + fclose(file); return 1; } @@ -176,7 +177,7 @@ int main(int argc, char **argv) frames = capture_sample(file, card, device, header.num_channels, header.sample_rate, format, period_size, period_count, cap_time); - printf("Captured %d frames\n", frames); + printf("Captured %u frames\n", frames); /* write header now all information is known */ header.data_sz = frames * header.block_align; @@ -222,7 +223,7 @@ unsigned int capture_sample(FILE *file, unsigned int card, unsigned int device, size = pcm_frames_to_bytes(pcm, pcm_get_buffer_size(pcm)); buffer = malloc(size); if (!buffer) { - fprintf(stderr, "Unable to allocate %d bytes\n", size); + fprintf(stderr, "Unable to allocate %u bytes\n", size); free(buffer); pcm_close(pcm); return 0; @@ -134,7 +134,7 @@ static void tinymix_list_controls(struct mixer *mixer) num_ctls = mixer_get_num_ctls(mixer); - printf("Number of controls: %d\n", num_ctls); + printf("Number of controls: %u\n", num_ctls); if (g_tabs_only) printf("ctl\ttype\tnum\tname\tvalue"); @@ -372,7 +372,7 @@ static int tinymix_set_value(struct mixer *mixer, const char *control, /* Set multiple values */ if (num_values > num_ctl_values) { fprintf(stderr, - "Error: %d values given, but control only takes %d\n", + "Error: %u values given, but control only takes %u\n", num_values, num_ctl_values); return EINVAL; } diff --git a/tinypcminfo.c b/tinypcminfo.c index b2d11bc..a8ea627 100644 --- a/tinypcminfo.c +++ b/tinypcminfo.c @@ -125,7 +125,7 @@ int main(int argc, char **argv) argv++; } - printf("Info for card %d, device %d:\n", card, device); + printf("Info for card %u, device %u:\n", card, device); for (i = 0; i < 2; i++) { struct pcm_params *params; |