diff options
author | Constantine Sapuntzakis <csapuntz@cvs.openbsd.org> | 1998-07-09 20:10:27 +0000 |
---|---|---|
committer | Constantine Sapuntzakis <csapuntz@cvs.openbsd.org> | 1998-07-09 20:10:27 +0000 |
commit | 3c5094a041e515f7fe842e22849850b85f1f479c (patch) | |
tree | b989a2f0ca1baba5590c4d39068cca489b36e0a4 /usr.bin/cdio | |
parent | 9c3eaf73eb4e69f5c8352b85f132b639e7fd8238 (diff) |
Play CDs with more than 100 tracks
Diffstat (limited to 'usr.bin/cdio')
-rw-r--r-- | usr.bin/cdio/cdio.c | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/usr.bin/cdio/cdio.c b/usr.bin/cdio/cdio.c index 4a77a806a95..1a275d5aa61 100644 --- a/usr.bin/cdio/cdio.c +++ b/usr.bin/cdio/cdio.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cdio.c,v 1.10 1998/07/09 19:09:59 csapuntz Exp $ */ +/* $OpenBSD: cdio.c,v 1.11 1998/07/09 20:10:26 csapuntz Exp $ */ /* * Compact Disc Control Utility by Serge V. Vakulenko <vak@cronyx.ru>. * Based on the non-X based CD player by Jean-Marc Zucconi and @@ -97,7 +97,7 @@ struct cmdtab { { 0, } }; -struct cd_toc_entry toc_buffer[100]; +struct cd_toc_entry *toc_buffer; char *cdname; int fd = -1; @@ -1005,6 +1005,18 @@ int read_toc_entrys (len) { struct ioc_read_toc_entry t; + if (toc_buffer) { + free(toc_buffer); + toc_buffer = 0; + } + + toc_buffer = malloc (len); + + if (!toc_buffer) { + errno = ENOMEM; + return (-1); + } + t.address_format = msf ? CD_MSF_FORMAT : CD_LBA_FORMAT; t.starting_track = 0; t.data_len = len; |