[PATCH] Fix dvbnet -h crash when invoked without a path to dvbnet

Ville Skyttä <[email protected]> Sat, 5 Jun 2010 12:44:23 +0300
Newsgroups gmane.linux.drivers.dvb
Message-ID <[email protected]>
Hi,

The attached patch fixes a dvbnet -h crash when invoked without a path to 
dvbnet.

_______________________________________________
linux-dvb users mailing list
For V4L/DVB development, please use instead [email protected]
[email protected]
http://www.linuxtv.org/cgi-bin/mailman/listinfo/linux-dvb
dvb-apps-1.1.1-dvbnet-h-597604.patch (text/x-patch, 639 B)
# HG changeset patch
# User Ville Skyttä <[email protected]>
# Date 1275729484 -10800
# Node ID acb8124295190a9ee1de02a45ffdc6059eae0e63
# Parent  5631d8b9250c3c9e6f35542851e3fe0460f0315e
Fix dvbnet -h crash when invoked without a path to dvbnet.

diff -r 5631d8b9250c -r acb812429519 util/dvbnet/dvbnet.c
--- a/util/dvbnet/dvbnet.c	Tue Jun 01 16:25:03 2010 +0200
+++ b/util/dvbnet/dvbnet.c	Sat Jun 05 12:18:04 2010 +0300
@@ -178,8 +178,8 @@
 			exit(OK);
 		case 'h':
 		default:
-			s = strrchr(argv[0], '/') + 1;
-			usage((s) ? s : argv[0]);
+			s = strrchr(argv[0], '/');
+			usage((s) ? s + 1 : argv[0]);
 			exit(FAIL);
 		}
 	}