Uploaded image for project: 'HPCC'
  1. HPCC
  2. HPCC-23067

Catch incorrect uses of strcmp/stricmp

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 7.6.12
    • Component/s: JLib
    • Labels:
      None

      Description

      HPCC-23066 was caused by incorrect use of stricmp - not comparing it against 0.

       

      Mark Kelly suggested running something like the following:

       

      grep -nRE 'strcmp|stricmp' - | grep if | grep -Ev '==|<|>|!=|!str'
      

      to catch situations where the function has not been used correctly.

      I actually used:

      find . -type f -print0 | xargs -0 grep -nRE 'strcmp|stricmp' - | grep if | grep -Ev '==|<|>|!=|!str'
      

      It would also be worth apply the same check with memcmp/memicmp

       

        Attachments

          Activity

            People

            • Assignee:
              ghalliday Gavin Halliday
              Reporter:
              ghalliday Gavin Halliday
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: