mu: some cosmetics / minor cleanup
This commit is contained in:
@ -595,6 +595,7 @@ clear_links (const gchar* dirname, DIR *dir, GError **err)
|
||||
const char *fp;
|
||||
char *fullpath;
|
||||
unsigned char d_type;
|
||||
guint len;
|
||||
|
||||
/* ignore empty, dot thingies */
|
||||
if (entry->d_name[0] == '\0' || entry->d_name[0] == '.')
|
||||
@ -604,8 +605,9 @@ clear_links (const gchar* dirname, DIR *dir, GError **err)
|
||||
* it returns a static buffer and we are
|
||||
* recursive*/
|
||||
fp = mu_str_fullpath_s (dirname, entry->d_name);
|
||||
fullpath = g_newa (char, strlen(fp) + 1);
|
||||
strcpy (fullpath, fp);
|
||||
len = strlen(fp);
|
||||
fullpath = g_newa (char, len + 1);
|
||||
strncpy (fullpath, fp, len);
|
||||
|
||||
d_type = GET_DTYPE (entry, fullpath);
|
||||
|
||||
@ -767,18 +769,11 @@ mu_maildir_get_maildir_from_path (const char* path)
|
||||
static char*
|
||||
get_new_basename (void)
|
||||
{
|
||||
char hostname[64];
|
||||
|
||||
if (gethostname (hostname, sizeof(hostname)) == -1)
|
||||
memcpy (hostname, "localhost", sizeof(hostname));
|
||||
else
|
||||
hostname[sizeof(hostname)-1] = '\0';
|
||||
|
||||
return g_strdup_printf ("%u.%08x%08x.%s",
|
||||
(guint)time(NULL),
|
||||
g_random_int(),
|
||||
(gint32)g_get_monotonic_time (),
|
||||
hostname);
|
||||
g_get_host_name ());
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -888,7 +888,7 @@ mu_msg_find_index_for_cid (MuMsg *msg, MuMsgOptions opts,
|
||||
|
||||
return get_matching_part_index (msg, opts,
|
||||
(MuMsgPartMatchFunc)match_cid,
|
||||
(gpointer)(char*)cid);
|
||||
(gpointer)cid);
|
||||
}
|
||||
|
||||
struct _RxMatchData {
|
||||
|
||||
@ -437,7 +437,6 @@ mu_util_fputs_encoded (const char *str, FILE *stream)
|
||||
unsigned bytes;
|
||||
char *conv;
|
||||
|
||||
g_return_val_if_fail (str, FALSE);
|
||||
g_return_val_if_fail (stream, FALSE);
|
||||
|
||||
/* g_get_charset return TRUE when the locale is UTF8 */
|
||||
@ -557,5 +556,3 @@ mu_util_read_password (const char *prompt)
|
||||
|
||||
return g_strdup (pass);
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user