Project

General

Profile

Bug #9316

ldap: comparison between pointer and zero character constant

Added by Toomas Soome over 1 year ago. Updated over 1 year ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
cmd - userland programs
Start date:
2018-03-19
Due date:
% Done:

100%

Estimated time:
Difficulty:
Medium
Tags:

Description

issues found by gcc 7 build:

    ../common/ldapsearch.c:243:44: error: comparison between pointer and zero character constant [-Werror=pointer-compare]
      } else if ( sortattr == NULL || *sortattr == '\0' || server_sort) {
                                                ^~
    ../common/ldapsearch.c:243:34: note: did you mean to dereference the pointer?
      } else if ( sortattr == NULL || *sortattr == '\0' || server_sort) {
                                      ^
    ../ns_ldap/ldapclient.c:2526:36: error: comparison between pointer and zero character constant [-Werror=pointer-compare]
      if (adminDN == NULL || adminDN[0] == '\0') {
                                        ^~
    ../ns_ldap/ldapclient.c:2526:25: note: did you mean to dereference the pointer?
      if (adminDN == NULL || adminDN[0] == '\0') {
                             ^
    ../ns_ldap/ldapclient.c:2535:48: error: comparison between pointer and zero character constant [-Werror=pointer-compare]
      if (adminPassword == NULL || adminPassword[0] == '\0') {
                                                    ^~
    ../ns_ldap/ldapclient.c:2535:31: note: did you mean to dereference the pointer?
      if (adminPassword == NULL || adminPassword[0] == '\0') {
                                   ^
    ../ns_ldap/ldapaddent.c:112:11: error: comparison between pointer and zero character constant [-Werror=pointer-compare]
      while (c != '\0' && *c == ' ')
               ^~
    ../ns_ldap/ldapaddent.c:112:9: note: did you mean to dereference the pointer?
      while (c != '\0' && *c == ' ')
             ^
    ../ns_ldap/ldapaddent.c: In function 'genent_aliases':
    ../ns_ldap/ldapaddent.c:2100:10: error: comparison between pointer and zero character constant [-Werror=pointer-compare]
      if (++t == '\0') {
              ^~
    ../ns_ldap/ldapaddent.c:2100:6: note: did you mean to dereference the pointer?
      if (++t == '\0') {
          ^~

    cc1: all warnings being treated as errors

History

#1

Updated by Electric Monk over 1 year ago

  • % Done changed from 90 to 100
  • Status changed from In Progress to Closed

git commit 3718f283515535a82b83e368bda0af10d2bf2c4f

commit  3718f283515535a82b83e368bda0af10d2bf2c4f
Author: Toomas Soome <tsoome@me.com>
Date:   2018-03-25T18:16:20.000Z

    9316 ldap: comparison between pointer and zero character constant
    Reviewed by: Dominic Hassler <hadfl@omniosce.org>
    Reviewed by: C Fraire <cfraire@me.com>
    Reviewed by: Andy Fiddaman <omnios@citrus-it.co.uk>
    Approved by: Gordon Ross <gwr@nexenta.com>

Also available in: Atom PDF