Bug#1102029: atsc_epg doesn't work on architectures with char as an unsigned type
John Scott
jscott at posteo.net
Fri Apr 4 01:32:22 BST 2025
Package: dvb-apps
Version: 1.1.1+rev1500-2
Severity: normal
File: /usr/bin/atsc_epg
Tags: upstream
Hi,
On ARM64—and presumably other architectures where the shell command 'getconf CHAR_MIN' prints '0'—the atsc_epg program is unusable. Even when it is invoked correctly, it always prints help information and exits indicating failure:
$ atsc_epg -f 539000000
usage: atsc_epg [-a <n>] -f <frequency> [-p <period>] [-m <modulation>] [-t] [-h]
The cause is an error in the option parsing code at util/atsc_epg/atsc_epg.c:1111 available on Salsa at
https://salsa.debian.org/vdr-team/linuxtv-dvb-apps/-/blob/master/util/atsc_epg/atsc_epg.c#L1111
When parsing the command-line options, the return value of getopt() is always stored in an object with type 'char' but getopt() always returns an 'int'. When all options have been read, getopt() returns -1, but when 'char' is an unsigned type, this gets implicitly converted to 255 and then the default case in the 'switch' statement is invoked. I haven't tested it but changing the declaration of 'c' to 'int' should fix this.
The build logs don't seem very verbose; maybe it should be looked into if the right options are getting passed to the compiler. GCC usually catches issues like this easily.
Thanks,
John
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 228 bytes
Desc: This is a digitally signed message part
URL: <http://alioth-lists.debian.net/pipermail/pkg-vdr-dvb-devel/attachments/20250404/1fdd2b36/attachment.sig>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 6270 bytes
Desc: not available
URL: <http://alioth-lists.debian.net/pipermail/pkg-vdr-dvb-devel/attachments/20250404/1fdd2b36/attachment.p7s>
More information about the pkg-vdr-dvb-devel
mailing list