openldap: prefer using ldap_err2string() over sstrerror()
authorMarc Fournier <marc.fournier@camptocamp.com>
Wed, 20 Aug 2014 10:27:21 +0000 (12:27 +0200)
committerMarc Fournier <marc.fournier@camptocamp.com>
Fri, 29 Aug 2014 13:09:55 +0000 (15:09 +0200)
src/openldap.c

index 08c6503..46d9267 100644 (file)
@@ -66,9 +66,8 @@ static int ldap_init_host (ldap_t *st) /* {{{ */
        rc = ldap_initialize (&ld, st->url);
        if (rc != LDAP_SUCCESS)
        {
-               char errbuf[1024];
-               sstrerror (errno, errbuf, sizeof (errbuf));
-               ERROR ("ldap_initialize failed: %s", errbuf);
+               ERROR ("openldap plugin: ldap_initialize failed: %s",
+                       ldap_err2string (rc));
                st->state = 0;
                return (-1);
        }