]> granicus.if.org Git - curl/commitdiff
ldap: Fixed DN variable warnings when Unicode is enabled
authorSteve Holme <steve_holme@hotmail.com>
Sat, 3 Jan 2015 21:12:56 +0000 (21:12 +0000)
committerSteve Holme <steve_holme@hotmail.com>
Sun, 4 Jan 2015 16:21:13 +0000 (16:21 +0000)
Use 'TCHAR *' for local DN variable rather than 'char *'.

lib/ldap.c

index fc027f7863cbacc06ab6bd987ea21e65a446e86e..7e9ac8935c4810359d2cf0d8bab5bc82c900ffdd 100644 (file)
@@ -430,8 +430,14 @@ static CURLcode Curl_ldap(struct connectdata *conn, bool *done)
 
     /* Get the DN and write it to the client */
     {
+#if defined(CURL_LDAP_WIN) && \
+    (defined(USE_WIN32_IDN) || defined(USE_WINDOWS_SSPI))
+      TCHAR *dn = ldap_get_dn(server, entryIterator);
+      size_t dn_len = _tcslen(dn);
+#else
       char  *dn = ldap_get_dn(server, entryIterator);
       size_t dn_len = strlen(dn);
+#endif
 
       result = Curl_client_write(conn, CLIENTWRITE_BODY, (char *)"DN: ", 4);
       if(result) {