/*
- * Sylpheed -- a GTK+ based, lightweight, and fast e-mail client
- * Copyright (C) 1999-2012 Hiroyuki Yamamoto and the Claws Mail team
+ * Claws Mail -- a GTK+ based, lightweight, and fast e-mail client
+ * Copyright (C) 1999-2015 Hiroyuki Yamamoto 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
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
+ *
*/
#ifdef HAVE_CONFIG_H
case P_PASSWORD:
g_free(*((gchar **)param[i].data));
if (value[0] == '!') {
- gchar *tmp, buf[1024];
+ gchar *tmp;
gsize len;
tmp = g_base64_decode(&value[1], &len);
- g_strlcat(buf, tmp, 1024);
- g_free(tmp);
- buf[len] = '\0';
- passcrypt_decrypt(buf, len);
+ passcrypt_decrypt(tmp, len);
+
*((gchar **)param[i].data) =
- *buf ? g_strdup(buf) : NULL;
+ *tmp ? g_strdup(tmp) : NULL;
+ g_free(tmp);
} else {
*((gchar **)param[i].data) =
*value ? g_strdup(value) : NULL;
g_snprintf(buf, sizeof(buf), "%s=!%s\n", param[i].name,
tmp ?
tmp : "");
+ g_free(tmp);
}
break;
default:
if (rcfile)
fp = g_fopen(rcfile, "rb");
if (!fp) {
- debug_print("cache: %s: %s\n", rcfile?rcfile:"(null)", strerror(errno));
+ debug_print("cache: %s: %s\n", rcfile?rcfile:"(null)", g_strerror(errno));
return -1;
}