summaryrefslogtreecommitdiff
path: root/example
diff options
context:
space:
mode:
authorrocky <rocky@gnu.org>2011-05-30 15:19:22 -0400
committerrocky <rocky@gnu.org>2011-05-30 15:19:22 -0400
commit940b7cd848cb5f89c5f28232055e580d8ff0a056 (patch)
tree5104c73927000f6d47312c49df1f123aec8922c2 /example
parent9be098033721e4c477197fa206a4c12412311a95 (diff)
patch from Honza Horak using Coverity's static analysis tool.
Diffstat (limited to 'example')
-rw-r--r--example/audio.c1
-rw-r--r--example/mmc2a.c4
-rw-r--r--example/paranoia.c4
3 files changed, 7 insertions, 2 deletions
diff --git a/example/audio.c b/example/audio.c
index 4977222a..57c187b5 100644
--- a/example/audio.c
+++ b/example/audio.c
@@ -335,6 +335,7 @@ main(int argc, char *argv[])
i_volume_level = atoi(optarg);
todo = SET_VOLUME;
}
+ break;
case 't':
if (NULL != (h = strchr(optarg,'-'))) {
*h = 0;
diff --git a/example/mmc2a.c b/example/mmc2a.c
index 2ba1a461..9b74cf6e 100644
--- a/example/mmc2a.c
+++ b/example/mmc2a.c
@@ -40,7 +40,7 @@
static void
print_mode_sense (const char *psz_drive, const char *six_or_ten,
- const uint8_t buf[22])
+ const uint8_t buf[30])
{
printf("Mode sense %s information for %s:\n", six_or_ten, psz_drive);
if (buf[2] & 0x01) {
@@ -210,7 +210,7 @@ main(int argc, const char *argv[])
printf("Couldn't find CD\n");
return 77;
} else {
- uint8_t buf[22] = { 0, }; /* Place to hold returned data */
+ uint8_t buf[30] = { 0, }; /* Place to hold returned data */
char *psz_cd = cdio_get_default_device(p_cdio);
if (DRIVER_OP_SUCCESS == mmc_mode_sense_6(p_cdio, buf, sizeof(buf),
CDIO_MMC_CAPABILITIES_PAGE) ) {
diff --git a/example/paranoia.c b/example/paranoia.c
index 8a904168..7f63a53b 100644
--- a/example/paranoia.c
+++ b/example/paranoia.c
@@ -131,6 +131,10 @@ main(int argc, const char *argv[])
track_t i_track = cdda_sector_gettrack(d, i_first_lsn);
lsn_t i_last_lsn = cdda_track_lastsector(d, i_track);
int fd = creat("track1s.wav", 0644);
+ if (-1 == fd) {
+ printf("Unable to create track1s.wav\n");
+ exit(1);
+ }
/* For demo purposes we'll read only 300 frames (about 4
seconds). We don't want this to take too long. On the other