summaryrefslogtreecommitdiff
path: root/usr.bin/cdio
diff options
context:
space:
mode:
authorFederico G. Schwindt <fgsch@cvs.openbsd.org>2008-04-27 23:06:41 +0000
committerFederico G. Schwindt <fgsch@cvs.openbsd.org>2008-04-27 23:06:41 +0000
commitaf2fd12d3de0ff37ed57efb92ebd3c844d1449a4 (patch)
tree4ef1e92247c5f510be3814f352f0a4e76baf6686 /usr.bin/cdio
parent028861bfcace6701d09d9207ff02aa03d0687748 (diff)
o if no argument is passed to cddbinfo, treat it as 0 in order to print
the list in case of multiple/inexact matches o if the argument to cddb is invalid, do not exit, just print and error and ignore the command espie@ ok.
Diffstat (limited to 'usr.bin/cdio')
-rw-r--r--usr.bin/cdio/cddb.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/usr.bin/cdio/cddb.c b/usr.bin/cdio/cddb.c
index 4fd7c6e3151..4882f086d9d 100644
--- a/usr.bin/cdio/cddb.c
+++ b/usr.bin/cdio/cddb.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cddb.c,v 1.14 2007/09/10 16:31:35 cloder Exp $ */
+/* $OpenBSD: cddb.c,v 1.15 2008/04/27 23:06:40 fgsch Exp $ */
/*
* Copyright (c) 2002 Marc Espie.
*
@@ -295,8 +295,10 @@ cddb(const char *host_port, int n, struct cd_toc_entry *e, char *arg)
}
if (strcmp(line, "211") == 0 || strcmp(line, "212") == 0) {
int number = strtonum(arg, 0, INT_MAX, &errstr);
- if (errstr != NULL)
- errx(1, "%s: %s", errstr, arg);
+ if (errstr != NULL && *arg != NULL) {
+ warnx("cddb: invalid index");
+ goto end;
+ }
if (number == 0) {
if (strcmp(line, "211") == 0)
printf("cddb: multiple matches\n");