[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-bugs-dist
Subject: Bug#40541: Solaris: Problems using timezones
From: Michael Ritzert <kde () ritzert ! de>
Date: 2002-08-31 9:50:52
[Download RAW message or body]
The attached patch can't be completely correct:
+ fgets(tempstring, 100, f);
+ tempstring(strlen(tempstring) - 1] = '\0';
+ sCurrentlySet = QString(tempstring);
is
a) syntactically wrong: it should obviously be [strlen(...)-1] with two square
brackets.
b) semantically bogus: strlen works by walking along the string and looking
for a '\0'. So either there already is one and the whole line is void or
there isn't one and you're accessing memory you'd better leave alone. Looking
at the fgets man page, the former is the case and the line can simply be
removed.
This is not meant to be a statement about the overall correctness of the patch
beyond this obvious issue.
Michael
(Complete bug history is available at http://bugs.kde.org/db/40/40541.html)
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic