diff mbox

[2/7] libdvbv5: fix asprintf compile warning in dvbv5-scan

Message ID 1397082420-31198-2-git-send-email-neolynx@gmail.com (mailing list archive)
State New, archived
Headers show

Commit Message

André Roth April 9, 2014, 10:26 p.m. UTC
Signed-off-by: André Roth <neolynx@gmail.com>
---
 utils/dvb/dvbv5-scan.c |    7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
diff mbox

Patch

diff --git a/utils/dvb/dvbv5-scan.c b/utils/dvb/dvbv5-scan.c
index 501b332..7eb3bf5 100644
--- a/utils/dvb/dvbv5-scan.c
+++ b/utils/dvb/dvbv5-scan.c
@@ -407,6 +407,7 @@  int main(int argc, char **argv)
 {
 	struct arguments args;
 	int err, lnb = -1,idx = -1;
+	int r;
 	const struct argp argp = {
 		.options = options,
 		.parser = parse_opt,
@@ -459,8 +460,12 @@  int main(int argc, char **argv)
 		return -1;
 	}
 
-	asprintf(&args.demux_dev,
+	r = asprintf(&args.demux_dev,
 		 "/dev/dvb/adapter%i/demux%i", args.adapter_dmx, args.demux);
+	if (r < 0) {
+		fprintf(stderr, "asprintf error\n" );
+		return -1;
+	}
 
 	if (verbose)
 		fprintf(stderr, "using demux '%s'\n", args.demux_dev);