format = g_strdup("NO FORMAT");
}
- g_stat(page->name, &st);
+ if (g_stat(page->name, &st) == -1) {
+ alertpanel_error("Could not get size of archive file '%s'.", page->name);
+ return;
+ }
dialog = gtk_dialog_new_with_buttons(
_("Archive result"),
GTK_WINDOW(mainwin->window),
STRING2, msg, -1);
g_free(msg);
- msg = g_strdup(gtk_entry_get_text(GTK_ENTRY(page->isoDate)));
- if (msg) {
- gtk_list_store_append(list, &iter);
- gtk_list_store_set(
- list, &iter,
- STRING1, _("Select mails before"),
- STRING2, msg, -1);
- }
+ msg = g_strdup(gtk_entry_get_text(GTK_ENTRY(page->isoDate)));
+ if (msg) {
+ gtk_list_store_append(list, &iter);
+ gtk_list_store_set(
+ list, &iter,
+ STRING1, _("Select mails before"),
+ STRING2, msg, -1);
+ }
g_free(msg);
- gtk_window_set_default_size(GTK_WINDOW(dialog), 320, 260);
+ gtk_window_set_default_size(GTK_WINDOW(dialog), 320, 260);
gtk_widget_show_all(dialog);
}
i_out = 0;
while(*in) {
if(*in == '<') {
- if(i_out+3 >= STR_MAX_LEN) break;
+ if(i_out+3 > STR_MAX_LEN) break;
memcpy(&(tmp_str[i_out]),"<",4);
in++; i_out += 4;
}
else if(*in == '>') {
- if(i_out+3 >= STR_MAX_LEN) break;
+ if(i_out+3 > STR_MAX_LEN) break;
memcpy(&(tmp_str[i_out]),">",4);
in++; i_out += 4;
}
else if(*in == '&') {
- if(i_out+4 >= STR_MAX_LEN) break;
+ if(i_out+4 > STR_MAX_LEN) break;
memcpy(&(tmp_str[i_out]),"&",5);
in++; i_out += 5;
}
else {
- if(i_out >= STR_MAX_LEN) break;
+ if(i_out > STR_MAX_LEN) break;
tmp_str[i_out++] = *in++;
}
}
"%d new mail messages arrived",
popup.num_mail),
popup.num_mail);
- tmp = g_strdup_printf("%s%s%s",utf8_str,str_empty?"":"\n",msg);
+ tmp = g_strdup_printf("%s%s%s",utf8_str,"",msg);
g_free(msg);
g_free(utf8_str);
utf8_str = tmp;
log_warning(LOG_PROTOCOL,
_("RSSyl: Couldn't delete old OPML file '%s': %s\n"),
opmlfile, g_strerror(errno));
- debug_print("RSSyl: couldn't delete old file '%s'\n", opmlfile);
+ debug_print("RSSyl: Couldn't delete old file '%s'\n", opmlfile);
g_free(opmlfile);
return;
}
url = (gchar *)gtk_entry_get_text(GTK_ENTRY(ritem->feedprop->url));
if( strlen(url) && strcmp(ritem->url, url)) {
- if( ritem->url ) {
- rssyl_passwd_set(ritem, NULL);
- g_free(ritem->url);
- }
+ rssyl_passwd_set(ritem, NULL);
+ g_free(ritem->url);
ritem->url = g_strdup(url);
}
ctx->expired_ids = g_slist_prepend(ctx->expired_ids,
g_strdup(feed_item_get_id(item)));
fctx = (RFeedCtx *)item->data;
- g_remove(fctx->path);
+ if (g_remove(fctx->path) != 0) {
+ debug_print("RSSyl: couldn't delete expiring item file '%s'\n",
+ fctx->path);
+ }
}
}
feed_item_get_parent_id(item), (GCompareFunc)g_strcmp0)) {
debug_print("RSSyl: expiring comment '%s'\n", feed_item_get_id(item));
fctx = (RFeedCtx *)item->data;
- g_remove(fctx->path);
+ if (g_remove(fctx->path) != 0) {
+ debug_print("RSSyl: couldn't delete expiring comment file '%s'\n",
+ fctx->path);
+ }
}
}
}
g_free(ctx);
- g_remove(old_feeds_xml);
+ if (g_remove(old_feeds_xml) != 0) {
+ debug_print("RSSyl: Couldn't delete '%s'\n", old_feeds_xml);
+ }
g_free(old_feeds_xml);
}
move_file(fpath, nfpath, FALSE);
g_free(nfpath);
}
- g_remove(fpath);
+ if (g_remove(fpath) != 0) {
+ debug_print("RSSyl: (FORMAT) couldn't delete '%s'\n", fpath);
+ }
g_free(fpath);
}
FILE *fp = get_tmpfile_in_dir(get_mime_tmp_dir(), &tmpfilename);
GStatBuf statbuf;
gboolean result = FALSE;
+ gint ret;
if (!fp) {
g_free(tmpfilename);
return NULL;
result = SaveVCard(fp, tnef);
fclose(fp);
- g_stat(tmpfilename, &statbuf);
- sub_info->tmp = TRUE;
- sub_info->length = statbuf.st_size;
- sub_info->encoding_type = ENC_BINARY;
-
- if (!result) {
+
+ ret = g_stat(tmpfilename, &statbuf);
+ if (ret == -1) {
+ debug_printf("couldn't stat tmpfilename '%s'\n", tmpfilename);
+ }
+
+ if ((ret == -1) || !result) {
claws_unlink(tmpfilename);
procmime_mimeinfo_free_all(&sub_info);
return tnef_broken_mimeinfo(_("Failed to parse VCard data."));
}
+
+ sub_info->tmp = TRUE;
+ sub_info->length = statbuf.st_size;
+ sub_info->encoding_type = ENC_BINARY;
return sub_info;
}
localtime_r(&t_start, &tm_start);
if (tm_start.tm_hour > 2)
gtk_adjustment_set_value(v_adj,
- (v_adj->upper-v_adj->page_size)/(24/(tm_start.tm_hour-2)));
+ ((v_adj->upper-v_adj->page_size)/(gdouble)(24/(tm_start.tm_hour-2))));
else
gtk_adjustment_set_value(v_adj, 0);
gtk_adjustment_changed(v_adj);
|| ((tm_date.tm_year%400) == 0)))
monthdays[1] = 29;
- if (offset_d > monthdays[mon]) {
+ if (offset_d > (int)monthdays[mon]) {
while (tm_date.tm_mday > 1)
orage_move_day(&tm_date, 1);
offset_d -= monthdays[mon];
gtk_table_attach(GTK_TABLE(dw->dtable_h), button, i, i+1, 0, 1
, (GTK_FILL), (0), 0, 0);
- if (++tm_date.tm_mday == (monthdays[tm_date.tm_mon]+1)) {
+ if (++tm_date.tm_mday == (int)(monthdays[tm_date.tm_mon]+1)) {
if (++tm_date.tm_mon == 12) {
++tm_date.tm_year;
tm_date.tm_mon = 0;
#if !GTK_CHECK_VERSION(3, 0, 0)
if (!colors_initialised) {
- gdk_color_parse("#ff7070", &red);
- colors_initialised = gdk_colormap_alloc_color(
- gdk_colormap_get_system(), &red, FALSE, TRUE);
+ if (!gdk_color_parse("#ff7070", &red)) {
+ g_warning("color parse failed: red");
+ colors_initialised = gdk_colormap_alloc_color(
+ gdk_colormap_get_system(), &red, FALSE, TRUE);
+ }
}
#endif
if (!g_ascii_strcasecmp(param[i].defval, "TRUE"))
*((gboolean *)param[i].data) = TRUE;
else
- *((gboolean *)param[i].data) =
- atoi(param[i].defval) ? TRUE : FALSE;
+ *((gboolean *)param[i].data) = atoi(param[i].defval) ? TRUE : FALSE;
} else
*((gboolean *)param[i].data) = FALSE;
break;
break;
case P_USHORT:
if (param[i].defval != NULL)
- *((gushort *)param[i].data) =
- (gushort)atoi(param[i].defval);
+ *((gushort *)param[i].data) = (gushort)atoi(param[i].defval);
else
*((gushort *)param[i].data) = 0;
break;
case P_COLOR:
if (param[i].defval != NULL && gdk_color_parse(param[i].defval, &color))
- *((gulong *)param[i].data) =
- RGB_FROM_GDK_COLOR(color);
+ *((gulong *)param[i].data) = RGB_FROM_GDK_COLOR(color);
else if (param[i].defval)
/* be compatible and accept ints */
*((gulong *)param[i].data) = strtoul(param[i].defval, 0, 10);