[linux-dvb] Asys P7131 Hybrid: DVB out of range
Manu Abraham
abraham.manu at gmail.com
Thu Sep 6 13:17:30 CEST 2007
Hi Obi,
Andreas Oberritter wrote:
> The strtol() function returns the result of the conversion, unless the
> value would underflow or overflow. If an underflow occurs, strtol()
> returns LONG_MIN. If an overflow occurs, strtol() returns LONG_MAX.
> In both cases, errno is set to ERANGE. Precisely the same holds for
> strtoll() (with LLONG_MIN and LLONG_MAX instead of LONG_MIN and
> LONG_MAX).
>
> My conclusion: Your channels.conf contains invalid frequency values.
> Tzap uses strtol() to parse those values and returns LONG_MAX.
>
> The error could be reported to the user by applying the attached patch.
>
> Regards,
> Andreas
>
Can you please apply it to the dvb-apps tree ?
Regards,
Manu
>
> ------------------------------------------------------------------------
>
> diff -r 1923f74d97ae util/szap/azap.c
> --- a/util/szap/azap.c Wed Jun 27 19:46:43 2007 +0200
> +++ b/util/szap/azap.c Thu Sep 06 02:47:52 2007 +0200
> @@ -104,6 +104,8 @@ int parse_int(int fd, int *val)
> };
>
> *val = strtol(number, NULL, 10);
> + if (errno == ERANGE)
> + return -4;
>
> return 0;
> }
> diff -r 1923f74d97ae util/szap/tzap.c
> --- a/util/szap/tzap.c Wed Jun 27 19:46:43 2007 +0200
> +++ b/util/szap/tzap.c Thu Sep 06 02:47:52 2007 +0200
> @@ -180,6 +180,8 @@ int parse_int(int fd, int *val)
> };
>
> *val = strtol(number, NULL, 10);
> + if (errno == ERANGE)
> + return -4;
>
> return 0;
> }
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> linux-dvb mailing list
> linux-dvb at linuxtv.org
> http://www.linuxtv.org/cgi-bin/mailman/listinfo/linux-dvb
More information about the linux-dvb
mailing list