From kde-bugs-dist Sat Aug 31 09:50:52 2002 From: Michael Ritzert Date: Sat, 31 Aug 2002 09:50:52 +0000 To: kde-bugs-dist Subject: Bug#40541: Solaris: Problems using timezones X-MARC-Message: https://marc.info/?l=kde-bugs-dist&m=103078824604538 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)