/*
* Sylpheed -- a GTK+ based, lightweight, and fast e-mail client
- * Copyright (C) 2001-2011 Match Grun and the Claws Mail team
+ * Copyright (C) 2001-2012 Match Grun and the Claws Mail team
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
#include "addritem.h"
#include "addrcache.h"
-#include "base64.h"
#include "utils.h"
#define LDIF_SEP_TAG ':'
*/
static gint ldif_hash_free_vis( gpointer key, gpointer value, gpointer data ) {
ldif_free_fieldrec( ( Ldif_FieldRec * ) value );
- value = NULL;
- key = NULL;
return -1;
}
long posEnd = 0L;
long posCur = 0L;
GHashTable *hashField;
+ gsize len;
hashField = ldifFile->hashFields;
rec = g_new0( Ldif_ParsedRec, 1 );
/* 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) {
- g_free(fullValue);
- fullValue = out;
- fullValue[len] = '\0';
- } else
- g_free(out);
+ gchar *tmp = g_base64_decode_zero(fullValue, &len);
+ g_free(fullValue);
+ fullValue = tmp;
}
- /* Base-64 encoded data */
- /*
- if( last64 ) {
- ldif_dump_b64( fullValue );
- }
- */
ldif_add_value( rec, lastTag, fullValue, hashField );
/* ldif_print_record( rec, stdout ); */
ldif_clear_rec( rec );
g_free( lastTag );
mgu_free_list( listValue );
+ g_free(fullValue);
lastTag = NULL;
listValue = NULL;
last64 = FALSE;
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) {
- g_free(fullValue);
- fullValue = out;
- fullValue[len] = '\0';
- } else
- g_free(out);
+ gchar *tmp = g_base64_decode_zero(fullValue, &len);
+ g_free(fullValue);
+ fullValue = tmp;
}
/* Base-64 encoded data */
/*
mgu_free_list( listValue );
lastTag = NULL;
listValue = NULL;
- last64 = FALSE;
}
lastTag = g_strdup( tagName );