Issue 96621 - svtools: ambiguous && ||
Summary: svtools: ambiguous && ||
Status: CLOSED FIXED
Alias: None
Product: utilities
Classification: Unclassified
Component: code (show other issues)
Version: DEV300m36
Hardware: All Linux, all
: P3 Trivial (vote)
Target Milestone: OOo 3.1
Assignee: carsten.driesner
QA Contact: Unknown
URL:
Keywords:
Depends on:
Blocks: 96084
  Show dependency tree
 
Reported: 2008-11-26 15:06 UTC by caolanm
Modified: 2009-03-02 10:50 UTC (History)
1 user (show)

See Also:
Issue Type: PATCH
Latest Confirmation in: ---
Developer Difficulty: ---


Attachments
fix to do what I suspect we meant to say (744 bytes, patch)
2008-11-26 15:07 UTC, caolanm
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this issue.
Description caolanm 2008-11-26 15:06:19 UTC
in svtools/source/svhtml/parhtml.cxx we have...
if( RTL_TEXTENCODING_UCS2 == eEnc &&
 (0xfe == (sal_uChar)pHeader[0] && 0xff == (sal_uChar)pHeader[1]) ||
 (0xff == (sal_uChar)pHeader[0] && 0xfe == (sal_uChar)pHeader[1]) )

which means
if( (RTL_TEXTENCODING_UCS2 == eEnc &&
 (0xfe == (sal_uChar)pHeader[0] && 0xff == (sal_uChar)pHeader[1])) ||
 (0xff == (sal_uChar)pHeader[0] && 0xfe == (sal_uChar)pHeader[1]) )

by operator precedence, I strongly suspect we mean

if
(
 RTL_TEXTENCODING_UCS2 == eEnc &&
 (
  (0xfe == (sal_uChar)pHeader[0] && 0xff == (sal_uChar)pHeader[1]) ||
  (0xff == (sal_uChar)pHeader[0] && 0xfe == (sal_uChar)pHeader[1])
 )
)

so patch attached to do that
Comment 1 caolanm 2008-11-26 15:07:13 UTC
Created attachment 58327 [details]
fix to do what I suspect we meant to say
Comment 2 carsten.driesner 2008-11-28 08:19:49 UTC
cd->cmc: Thanks for the patch. Indeed, the old code looks broken. Patch accepted
and added to CWS fwk95.
Comment 3 carsten.driesner 2008-11-28 12:55:06 UTC
cd: Fixed, committed to CWS fwk95.
Comment 4 carsten.driesner 2008-12-15 09:06:31 UTC
cd: Verified.
Comment 5 caolanm 2009-03-02 10:50:06 UTC
integrated DEV300_m40