File dvb-scan-dont-segfault.patch of Package dvb

"dvbscan" without parameters segfaults in the usage() message.
Just a cosmetic issue, but still worth fixing :-)
Because upstream is basically dead and uses an arcane version control,
this patch is not yet upstream.

Author: Stefan Seyfried <seife+obs@b1-systems.com>
Date: 2015-01-01

Index: b/util/scan/scan.c
===================================================================
--- a/util/scan/scan.c
+++ b/util/scan/scan.c
@@ -2580,7 +2580,7 @@ bad_usage(char *pname, int problem)
 		break;
 	case 2:
 		show_existing_tuning_data_files();
-		fprintf (stderr, usage, pname);
+		fprintf (stderr, usage, pname, output_charset);
 	}
 }
 
@@ -2594,11 +2594,6 @@ int main (int argc, char **argv)
 	const char *initial = NULL;
 	char *charset;
 
-	if (argc <= 1) {
-	    bad_usage(argv[0], 2);
-	    return -1;
-	}
-
 	/*
 	 * Get the environment charset, and use it as the default
 	 * output charset. In thesis, using nl_langinfo should be
@@ -2619,6 +2614,11 @@ int main (int argc, char **argv)
 	} else
 		output_charset = nl_langinfo(CODESET);
 
+	if (argc <= 1) {
+	    bad_usage(argv[0], 2);
+	    return -1;
+	}
+
 	/* start with default lnb type */
 	lnb_type = *lnb_enum(0);
 	while ((opt = getopt(argc, argv, "5cnpa:f:d:s:o:x:e:t:i:l:vquPA:UC:D:")) != -1) {
openSUSE Build Service is sponsored by