From: Pawel Date: Fri, 20 Jul 2012 13:59:02 +0000 (+0200) Subject: 0023337: The 'strcmp' function returns 0 if corresponding strings are equal. (1) X-Git-Tag: V6_5_4_beta1~97 X-Git-Url: http://git.dev.opencascade.org/gitweb/?a=commitdiff_plain;h=b28f4666f9d039953021e614f8d3f38262c9f3d4;p=occt-copy.git 0023337: The 'strcmp' function returns 0 if corresponding strings are equal. (1) Checking if the return value from 'strcmp' is '0'. --- diff --git a/src/IGESGraph/IGESGraph_ToolDrawingUnits.cxx b/src/IGESGraph/IGESGraph_ToolDrawingUnits.cxx index 58df069ff8..218b5b3151 100755 --- a/src/IGESGraph/IGESGraph_ToolDrawingUnits.cxx +++ b/src/IGESGraph/IGESGraph_ToolDrawingUnits.cxx @@ -93,26 +93,26 @@ Standard_Boolean IGESGraph_ToolDrawingUnits::OwnCorrect Standard_CString unm = ""; if (!ent->Unit().IsNull()) unm = ent->Unit()->ToCString(); switch (unf) { - case 1 : if (strcmp(unm,"IN") && strcmp(unm,"INCH")) + case 1 : if ((strcmp(unm,"IN") == 0) || (strcmp(unm,"INCH") == 0)) name = new TCollection_HAsciiString ("IN"); break; - case 2 : if (strcmp(unm,"MM")) + case 2 : if (strcmp(unm,"MM") == 0) name = new TCollection_HAsciiString ("MM"); break; case 3 : break; // nom libre - case 4 : if (strcmp(unm,"FT")) + case 4 : if (strcmp(unm,"FT") == 0) name = new TCollection_HAsciiString ("FT"); break; - case 5 : if (strcmp(unm,"MI")) + case 5 : if (strcmp(unm,"MI") == 0) name = new TCollection_HAsciiString ("MI"); break; - case 6 : if (strcmp(unm,"M")) + case 6 : if (strcmp(unm,"M") == 0) name = new TCollection_HAsciiString ("M"); break; - case 7 : if (strcmp(unm,"KM")) + case 7 : if (strcmp(unm,"KM") == 0) name = new TCollection_HAsciiString ("KM"); break; - case 8 : if (strcmp(unm,"MIL")) + case 8 : if (strcmp(unm,"MIL") == 0) name = new TCollection_HAsciiString ("MIL"); break; - case 9 : if (strcmp(unm,"UM")) + case 9 : if (strcmp(unm,"UM") == 0) name = new TCollection_HAsciiString ("UM"); break; - case 10 : if (strcmp(unm,"CM")) + case 10 : if (strcmp(unm,"CM") == 0) name = new TCollection_HAsciiString ("CM"); break; - case 11 : if (strcmp(unm,"UIN")) + case 11 : if (strcmp(unm,"UIN") == 0) name = new TCollection_HAsciiString ("UIN"); break; default : break; // on ne peut rien faire ... ? }