X-Git-Url: http://git.claws-mail.org/?p=claws.git;a=blobdiff_plain;f=src%2Fldif.c;h=89f750beac677750a82f234df82d75991dbcdc86;hp=54d90aa9894adfd6dd16373b6d2b3c2d3bdfcd5b;hb=a2068001ee3f0a797968d8db474aca447cc22015;hpb=5aae1530df967ed180f42673042c62214dd604f7 diff --git a/src/ldif.c b/src/ldif.c index 54d90aa98..89f750bea 100644 --- a/src/ldif.c +++ b/src/ldif.c @@ -32,7 +32,6 @@ #include "addritem.h" #include "addrcache.h" -#include "base64.h" #include "utils.h" #define LDIF_SEP_TAG ':' @@ -608,6 +607,8 @@ static void ldif_read_file( LdifFile *ldifFile, AddressCache *cache ) { long posEnd = 0L; long posCur = 0L; GHashTable *hashField; + gchar *out; + gsize len; hashField = ldifFile->hashFields; rec = g_new0( Ldif_ParsedRec, 1 ); @@ -641,10 +642,8 @@ static void ldif_read_file( LdifFile *ldifFile, AddressCache *cache ) { /* Save record */ fullValue = mgu_list_coalesce( listValue ); if (fullValue && last64) { - gchar *out = g_malloc(strlen(fullValue)); - int len = 0; - if ((len = base64_decode(out, fullValue, - strlen(fullValue))) >= 0) { + out = g_base64_decode(fullValue, &len); + if (len >= 0) { g_free(fullValue); fullValue = out; fullValue[len] = '\0'; @@ -692,10 +691,8 @@ static void ldif_read_file( LdifFile *ldifFile, AddressCache *cache ) { fullValue = mgu_list_coalesce( listValue ); if (fullValue && last64) { - gchar *out = g_malloc(strlen(fullValue)); - int len = 0; - if ((len = base64_decode(out, fullValue, - strlen(fullValue))) >= 0) { + out = g_base64_decode(fullValue, &len); + if (len >= 0) { g_free(fullValue); fullValue = out; fullValue[len] = '\0';