View Issue Details

IDProjectCategoryView StatusLast Update
0023336CommunityOCCT:Data Exchangepublic2012-11-16 13:17
ReporterPawel Assigned ToPawel  
PrioritynormalSeverityminor 
Status closedResolutionfixed 
PlatformAOSL 
Product Version6.5.3 
Target Version6.5.4Fixed in Version6.5.4 
Summary0023336: The 'strcmp' function returns 0 if corresponding strings are equal.
DescriptionIn RWStepShape_RWAngularLocation.cxx / RWStepShape_RWAngularSize.cxx

there are code blocks:

if (strcmp(text, ".EQUAL.")) aAngleSelection = StepShape_Equal;
else if (strcmp(text, ".LARGE.")) aAngleSelection = StepShape_Large;
else if (strcmp(text, ".SMALL.")) aAngleSelection = StepShape_Small;
else ach->AddFail("Parameter #3 (angle_selection) has not allowed value");

if, for example, text equals to ".EQUAL." the 'strcmp' function will return '0' and so the execution will process to

else if (strcmp(text, ".LARGE.")) aAngleSelection = StepShape_Large;

I don't think it was intended. I think at this point a pattern like:

if (strcmp(text, "STRING_TO_COMPARE") == 0) ...;

was intended.
TagsNo tags attached.
Test case numberNot needed

Relationships

related to 0023337 closedPawel The 'strcmp' function returns 0 if corresponding strings are equal. (1) 
related to 0023339 closedPawel The 'strcmp' function returns 0 if corresponding strings are equal. (2) 

Activities

Pawel

2012-07-20 16:57

developer   ~0021090

Corresponding git branch pushed. Please review.

abv

2012-07-23 13:52

manager   ~0021107

No remarks, please test

apn

2012-07-24 11:59

administrator   ~0021136

Dear BugMaster,
The workbenches
KAS:dev:apn-23336-occt (GIT branch CR23336)
KAS:dev:apn-23336-products (GIT master)
were compiled on Linux platform and tested.

Regression:
Not detected

Improvements:
Not detected

Testing case:
Not needed

See results in /QADisk/occttests/results/KAS/dev/apn-23336-products_23072012/lin
See reference results in /QADisk/occttests/results/KAS/dev/products-20120706-opt_06072012/lin
See test cases in /QADisk/occttests/tests/ED

Related Changesets

occt: master fafad173

2012-07-20 12:56:44

Pawel

Details Diff
0023336: The 'strcmp' function returns 0 if corresponding strings are equal.

Checking if the return value from 'strcmp' is '0'.
Affected Issues
0023336
mod - src/RWStepShape/RWStepShape_RWAngularLocation.cxx Diff File
mod - src/RWStepShape/RWStepShape_RWAngularSize.cxx Diff File

Issue History

Date Modified Username Field Change
2012-07-20 16:54 Pawel New Issue
2012-07-20 16:54 Pawel Assigned To => Pawel
2012-07-20 16:57 Pawel Note Added: 0021090
2012-07-20 16:57 Pawel Assigned To Pawel => bugmaster
2012-07-20 16:57 Pawel Status new => resolved
2012-07-20 17:51 Pawel Relationship added related to 0023337
2012-07-20 18:30 Pawel Relationship added related to 0023339
2012-07-23 13:52 abv Note Added: 0021107
2012-07-23 13:52 abv Status resolved => reviewed
2012-07-24 11:59 apn Note Added: 0021136
2012-07-24 11:59 apn Test case number => Not needed
2012-07-24 11:59 apn Status reviewed => tested
2012-07-30 16:31 Pawel Changeset attached => occt master fafad173
2012-07-30 16:32 Pawel Assigned To bugmaster => Pawel
2012-07-30 16:32 Pawel Status tested => verified
2012-07-30 16:32 Pawel Resolution open => fixed
2012-11-16 13:14 bugmaster Fixed in Version => 6.5.4
2012-11-16 13:17 bugmaster Status verified => closed