tlf-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Tlf-devel] another patch


From: Joop Stakenborg
Subject: [Tlf-devel] another patch
Date: Sun, 05 Dec 2004 21:33:07 +0100

My previous patch has caused another bug to appear which took me a while
to find. I have created a logcfg.dat with the lines:

SOUNDCARD
SIDETONE_VOLUME=70

Because the function parse_logcfg() uses strstr for string comparison,
tlf thinks we have a line with "TONE=" as the second line. At line 557
buff will now become "ONE_VOLUME=70\n\0" and atoi will gladly accept
this, causing tonestr to become "ONE".

This causes unexpected crashes at unexpected places, I have had a crash
when hitting Alt-w. The solution for this would be to use "CWTONE=" in
logcfg.dat from now on and refrain from using "TONE=", see attached
patch.

Some recommendations:
- The atoi function does no error checking, use with care.
- At some point we should stop using strstr() in parse_logcfg().

Regards,
Joop PG4I
-- 
Joop Stakenborg <address@hidden>

Attachment: patch.tone
Description: Text Data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]