#47328 389-dsgw: entrydisplay.c:2523: bad switch statement
Closed: wontfix None Opened 11 years ago by dcb.

source code file entrydisplay.c, line 2523 has code

switch ( tip->dsti_entrycount ) {
  case 0:
fmt = opt & 1
    ? ((tip->dsti_options & DSGW_DISPLAY_OPT_CUSTOM_SEARCHDESC)
       ? DBT_SearchFound0Entries_
       : DBT_SearchFound0EntriesWhere_)
    : ((tip->dsti_options & DSGW_DISPLAY_OPT_CUSTOM_SEARCHDESC)
       ? DBT_Found0Entries_
       : DBT_Found0EntriesWhere_);
  case 1:
fmt = opt & 1
    ? ((tip->dsti_options & DSGW_DISPLAY_OPT_CUSTOM_SEARCHDESC)
       ? DBT_SearchFound1Entry_
       : DBT_SearchFound1EntryWhere_)
    : ((tip->dsti_options & DSGW_DISPLAY_OPT_CUSTOM_SEARCHDESC)
       ? DBT_Found1Entry_
       : DBT_Found1EntryWhere_);
  default:
fmt = opt & 1
    ? ((tip->dsti_options & DSGW_DISPLAY_OPT_CUSTOM_SEARCHDESC)
       ? DBT_SearchFoundEntries_
       : DBT_SearchFoundEntriesWhere_)
    : ((tip->dsti_options & DSGW_DISPLAY_OPT_CUSTOM_SEARCHDESC)
       ? DBT_FoundEntries_
       : DBT_FoundEntriesWhere_);
}

Someone doesn't know that break; statements are required.
This problem found by cppcheck static C/C++ analyser.


commit 2bf6b8e06b77280eb0e7a83f4701316e75615388
Author: Rich Megginson rmeggins@redhat.com
Date: Mon Aug 19 09:40:55 2013 -0600

Metadata Update from @rmeggins:
- Issue set to the milestone: 389-dsgw 1.1.11

7 years ago

389-ds-base is moving from Pagure to Github. This means that new issues and pull requests
will be accepted only in 389-ds-base's github repository.

This issue has been cloned to Github and is available here:
- https://github.com/389ds/389-ds-base/issues/665

If you want to receive further updates on the issue, please navigate to the github issue
and click on subscribe button.

Thank you for understanding. We apologize for all inconvenience.

Metadata Update from @spichugi:
- Issue close_status updated to: wontfix (was: Fixed)

3 years ago

Login to comment on this ticket.

Metadata