commit 98b12b276ff17b22d83295998a0898de44e916f2 parent 307fff3ebaccb4ec82cfb836213bac8260443efb Author: Ricardo Mones <ricardo@mones.org> Date: Wed, 23 Sep 2015 23:24:14 +0200 Remove line breaks from g_warning() Diffstat:
97 files changed, 361 insertions(+), 363 deletions(-)
diff --git a/src/account.c b/src/account.c @@ -1364,7 +1364,7 @@ static void account_list_set(void) GtkTreeIter iter; if (!gtk_tree_model_iter_nth_child(model, &iter, NULL, row)) { - g_warning("%s(%d) - no iter found???\n", __FILE__, __LINE__); + g_warning("%s(%d) - no iter found???", __FILE__, __LINE__); continue; } @@ -1825,7 +1825,7 @@ gchar *account_get_signature_str(PrefsAccount *account) if (account->sig_type == SIG_FILE) { if (!is_file_or_fifo_exist(account->sig_path)) { - g_warning("can't open signature file: %s\n", + g_warning("can't open signature file: '%s'", account->sig_path); return NULL; } diff --git a/src/addrbook.c b/src/addrbook.c @@ -1328,7 +1328,7 @@ static gint addrbook_write_to(AddressBookFile *book, gchar *newFile) fileSpec = NULL; return book->retVal; fail: - g_warning("error writing AB\n"); + g_warning("error writing AB"); book->retVal = MGU_ERROR_WRITE; if (pfile) prefs_file_close_revert( pfile ); diff --git a/src/addressbook-dbus.c b/src/addressbook-dbus.c @@ -64,7 +64,7 @@ static gboolean init(GError** error) { if (connection == NULL || *error) { if (! *error) g_set_error(error, client_object_error_quark(), 1, "Unable to connect to dbus"); - g_warning("Unable to connect to dbus: %s\n", (*error)->message); + g_warning("Unable to connect to dbus: %s", (*error)->message); return FALSE; } @@ -73,7 +73,7 @@ static gboolean init(GError** error) { "/org/clawsmail/contacts", "org.clawsmail.Contacts"); if (proxy == NULL) { - g_warning("Could not get a proxy object\n"); + g_warning("Could not get a proxy object"); g_set_error(error, client_object_error_quark(), 1, "Could not get a proxy object"); return FALSE; } @@ -125,7 +125,7 @@ static gchar* convert_2_utf8(gchar* locale) { utf8 = g_convert(locale, -1, "UTF-8", current, &read, &write, &error); if (error) { - g_warning("Fail to convert [%s]: %s\n", charset, error->message); + g_warning("Failed to convert [%s]: %s", charset, error->message); g_free(current); return NULL; } @@ -478,7 +478,7 @@ static gboolean my_compose_create_hook(gpointer source, gpointer user_data) { void addressbook_install_hooks(GError** error) { if ((guint)-1 == hooks_register_hook( COMPOSE_CREATED_HOOKLIST, my_compose_create_hook, NULL)) { - g_warning("Could not register hook for adding vCards\n"); + g_warning("Could not register hook for adding vCards"); if (error) { g_set_error(error, client_object_error_quark(), 1, "Could not register hook for adding vCards"); diff --git a/src/addressbook.c b/src/addressbook.c @@ -4159,7 +4159,7 @@ void addressbook_read_file( void ) { if ( !is_dir_exist(indexdir) ) { if ( make_dir(indexdir) < 0 ) { addrindex_set_file_path( addrIndex, get_rc_dir() ); - g_warning( "couldn't create dir %s\n", indexdir); + g_warning( "couldn't create dir '%s'", indexdir); } else { if (!migrate_addrbook(get_rc_dir(), indexdir)) { remove_dir_recursive(indexdir); @@ -4747,7 +4747,7 @@ ItemObjectType addressbook_type2item( AddressObjectType abType ) { atci->iconXpm = icon; \ atci->iconXpmOpen = iconopen; \ } else { \ - g_warning("can't get atci %d\n", id); \ + g_warning("can't get atci %d", id); \ } \ } diff --git a/src/addressbook_foldersel.c b/src/addressbook_foldersel.c @@ -396,7 +396,7 @@ gboolean addressbook_foldersel_selection( AddressIndex *addrIndex, addressbook_foldersel_load_data( addrIndex, &folder_path_match ); if ( folder_path_match.folder_path != NULL && folder_path_match.matched == FALSE) - g_warning("addressbook_foldersel_load_data: couldn't match book/folder path '%s'\n", path); + g_warning("addressbook_foldersel_load_data: couldn't match book/folder path '%s'", path); g_strfreev( folder_path_match.folder_path ); diff --git a/src/addrindex.c b/src/addrindex.c @@ -1791,7 +1791,7 @@ static gint addrindex_write_to( AddressIndex *addrIndex, const gchar *newFile ) fileSpec = NULL; return addrIndex->retVal; fail: - g_warning("error writing AB index\n"); + g_warning("error writing AB index"); addrIndex->retVal = MGU_ERROR_WRITE; if (pfile) prefs_file_close_revert( pfile ); @@ -2918,7 +2918,7 @@ gboolean addrindex_load_completion( folderpath must not be empty or NULL */ if( ! addressbook_peek_folder_exists( folderpath, &book, &folder ) ) { - g_warning("addrindex_load_completion: folder path '%s' doesn't exist\n", folderpath); + g_warning("addrindex_load_completion: folder path '%s' doesn't exist", folderpath); return FALSE; } @@ -2972,7 +2972,7 @@ gboolean addrindex_load_completion( return TRUE; } else { - g_warning("addrindex_load_completion: book/folder path is valid but got no pointer\n"); + g_warning("addrindex_load_completion: book/folder path is valid but got no pointer"); } } return FALSE; diff --git a/src/autofaces.c b/src/autofaces.c @@ -45,7 +45,7 @@ static gint get_content_for_any_face(gchar *buf, gint len, gchar *anyname, gint if (fgets(buf, (len < maxlen)? len: maxlen, xfp) == NULL) { fclose(xfp); g_free(xfile); - g_warning("header content file '%s' read failure\n", anyname); + g_warning("header content file '%s' read failure", anyname); return -2; } lastc = strlen(buf) - 1; /* remove trailing \n */ @@ -98,7 +98,7 @@ gint get_account_xface(gchar *buf, gint len, gchar *name) { g_free(filename); return result; } - g_warning("header xface filename invalid\n"); + g_warning("header xface filename invalid"); return -1; } @@ -113,7 +113,7 @@ gint get_account_face(gchar *buf, gint len, gchar *name) { g_free(filename); return result; } - g_warning("header face filename invalid\n"); + g_warning("header face filename invalid"); return -1; } diff --git a/src/codeconv.c b/src/codeconv.c @@ -467,7 +467,7 @@ static gint conv_euctoutf8(gchar *outbuf, gint outlen, const gchar *inbuf) if (cd == (iconv_t)-1) { cd = iconv_open(CS_UTF_8, CS_EUC_JP); if (cd == (iconv_t)-1) { - g_warning("conv_euctoutf8(): %s\n", + g_warning("conv_euctoutf8(): %s", g_strerror(errno)); iconv_ok = FALSE; strncpy2(outbuf, inbuf, outlen); @@ -524,7 +524,7 @@ static gint conv_utf8toeuc(gchar *outbuf, gint outlen, const gchar *inbuf) if (cd == (iconv_t)-1) { cd = iconv_open(CS_EUC_JP, CS_UTF_8); if (cd == (iconv_t)-1) { - g_warning("conv_utf8toeuc(): %s\n", + g_warning("conv_utf8toeuc(): %s", g_strerror(errno)); iconv_ok = FALSE; strncpy2(outbuf, inbuf, outlen); @@ -956,7 +956,7 @@ gchar *conv_iconv_strdup_with_cd(const gchar *inbuf, iconv_t cd) } else if (E2BIG == errno) { EXPAND_BUF(); } else { - g_warning("conv_iconv_strdup(): %s\n", + g_warning("conv_iconv_strdup(): %s", g_strerror(errno)); break; } @@ -967,7 +967,7 @@ gchar *conv_iconv_strdup_with_cd(const gchar *inbuf, iconv_t cd) if (E2BIG == errno) { EXPAND_BUF(); } else { - g_warning("conv_iconv_strdup(): %s\n", + g_warning("conv_iconv_strdup(): %s", g_strerror(errno)); break; } @@ -1687,7 +1687,7 @@ void conv_encode_header_full(gchar *dest, gint len, const gchar *src, *dest = '\0'; return; } else { - g_warning("conv_encode_header(): code conversion failed\n"); + g_warning("conv_encode_header(): code conversion failed"); conv_unreadable_8bit(part_str); out_str = g_strdup(part_str); } @@ -1720,7 +1720,7 @@ void conv_encode_header_full(gchar *dest, gint len, const gchar *src, out_str = conv_codeset_strdup (part_str, cur_encoding, out_encoding); if (!out_str) { - g_warning("conv_encode_header(): code conversion failed\n"); + g_warning("conv_encode_header(): code conversion failed"); conv_unreadable_8bit(part_str); out_str = g_strdup(part_str); } @@ -1799,7 +1799,7 @@ gchar *conv_filename_to_utf8(const gchar *fs_file) utf8_file = g_filename_to_utf8(fs_file, -1, NULL, NULL, &error); if (error) { - g_warning("failed to convert encoding of file name: %s\n", + g_warning("failed to convert encoding of file name: %s", error->message); g_error_free(error); } diff --git a/src/common/plugin.c b/src/common/plugin.c @@ -151,7 +151,7 @@ void plugin_save_list(void) #endif if ((pfile = prefs_write_open(rcpath)) == NULL || (prefs_set_block_label(pfile, block) < 0)) { - g_warning("failed to write plugin list\n"); + g_warning("failed to write plugin list"); g_free(rcpath); return; } @@ -189,16 +189,16 @@ void plugin_save_list(void) goto revert; if (prefs_file_close(pfile) < 0) - g_warning("failed to write plugin list\n"); + g_warning("failed to write plugin list"); g_free(rcpath); continue; revert: - g_warning("failed to write plugin list\n"); + g_warning("failed to write plugin list"); if (prefs_file_close_revert(pfile) < 0) - g_warning("failed to revert plugin list\n"); + g_warning("failed to revert plugin list"); g_free(rcpath); } @@ -352,7 +352,7 @@ static gboolean plugin_licence_check(const gchar *licence) { len = strlen(licence); } if (len == 0) { - g_warning("plugin licence check failed: empty licence\n"); + g_warning("plugin licence check failed: empty licence"); return FALSE; } while (plugin_licence_tokens[i] != NULL) { @@ -616,7 +616,7 @@ void plugin_load_all(const gchar *type) replace_old_plugin_name(buf); if ((buf[0] != '\0') && (plugin_load(buf, &error) == NULL)) { - g_warning("plugin loading error: %s\n", error); + g_warning("plugin loading error: %s", error); g_free(error); } } diff --git a/src/common/prefs.c b/src/common/prefs.c @@ -77,7 +77,7 @@ PrefFile *prefs_write_open(const gchar *path) cm_return_val_if_fail(path != NULL, NULL); if (prefs_is_readonly(path)) { - g_warning("no permission - %s\n", path); + g_warning("no write permission on '%s'", path); return NULL; } @@ -145,7 +145,7 @@ gint prefs_file_close(PrefFile *pfile) /* next block */ if (buf[0] == '[') { if (fputs(buf, fp) == EOF) { - g_warning("failed to write configuration to file\n"); + g_warning("failed to write configuration to file"); prefs_file_close_revert(pfile); return -1; @@ -156,7 +156,7 @@ gint prefs_file_close(PrefFile *pfile) while (fgets(buf, sizeof(buf), orig_fp) != NULL) if (fputs(buf, fp) == EOF) { - g_warning("failed to write configuration to file\n"); + g_warning("failed to write configuration to file"); prefs_file_close_revert(pfile); return -1; @@ -312,7 +312,7 @@ gint prefs_set_block_label(PrefFile *pfile, const gchar *label) break; } else { if (fputs(buf, pfile->fp) == EOF) { - g_warning("failed to write configuration to file\n"); + g_warning("failed to write configuration to file"); prefs_file_close_revert(pfile); g_free(block_label); @@ -328,7 +328,7 @@ gint prefs_set_block_label(PrefFile *pfile, const gchar *label) if (fputs(block_label, pfile->fp) == EOF || fputc('\n', pfile->fp) == EOF) { - g_warning("failed to write configuration to file\n"); + g_warning("failed to write configuration to file"); prefs_file_close_revert(pfile); g_free(block_label); diff --git a/src/common/session.c b/src/common/session.c @@ -291,7 +291,7 @@ static gboolean session_timeout_cb(gpointer data) { Session *session = SESSION(data); - g_warning("session timeout.\n"); + g_warning("session timeout."); if (session->io_tag > 0) { g_source_remove(session->io_tag); @@ -393,7 +393,7 @@ gint session_start_tls(Session *session) sock_set_nonblocking_mode(session->sock, FALSE); if (!ssl_init_socket(session->sock)) { - g_warning("couldn't start TLS session.\n"); + g_warning("couldn't start TLS session."); if (nb_mode) sock_set_nonblocking_mode(session->sock, session->nonblocking); return -1; @@ -551,7 +551,7 @@ static gboolean session_read_msg_cb(SockInfo *source, GIOCondition condition, SESSION_BUFFSIZE - 1); if (read_len == -1 && session->state == SESSION_DISCONNECTED) { - g_warning ("sock_read: session disconnected\n"); + g_warning ("sock_read: session disconnected"); if (session->io_tag > 0) { g_source_remove(session->io_tag); session->io_tag = 0; @@ -560,7 +560,7 @@ static gboolean session_read_msg_cb(SockInfo *source, GIOCondition condition, } if (read_len == 0) { - g_warning("sock_read: received EOF\n"); + g_warning("sock_read: received EOF"); session->state = SESSION_EOF; return FALSE; } @@ -570,7 +570,7 @@ static gboolean session_read_msg_cb(SockInfo *source, GIOCondition condition, case EAGAIN: return TRUE; default: - g_warning("sock_read: %s\n", g_strerror(errno)); + g_warning("sock_read: %s", g_strerror(errno)); session->state = SESSION_ERROR; return FALSE; } @@ -646,7 +646,7 @@ static gboolean session_read_data_cb(SockInfo *source, GIOCondition condition, SESSION_BUFFSIZE); if (read_len == 0) { - g_warning("sock_read: received EOF\n"); + g_warning("sock_read: received EOF"); session->state = SESSION_EOF; return FALSE; } @@ -656,7 +656,7 @@ static gboolean session_read_data_cb(SockInfo *source, GIOCondition condition, case EAGAIN: return TRUE; default: - g_warning("sock_read: %s\n", g_strerror(errno)); + g_warning("sock_read: %s", g_strerror(errno)); session->state = SESSION_ERROR; return FALSE; } @@ -752,7 +752,7 @@ static gint session_write_buf(Session *session) write_len = 0; break; default: - g_warning("sock_write: %s\n", g_strerror(errno)); + g_warning("sock_write: %s", g_strerror(errno)); session->state = SESSION_ERROR; return -1; } @@ -795,7 +795,7 @@ static gint session_write_data(Session *session) write_len = 0; break; default: - g_warning("sock_write: %s\n", g_strerror(errno)); + g_warning("sock_write: %s", g_strerror(errno)); session->state = SESSION_ERROR; return -1; } diff --git a/src/common/socket.c b/src/common/socket.c @@ -189,7 +189,7 @@ gint sock_init(void) result = WSAStartup(MAKEWORD(2, 2), &wsadata); if (result != NO_ERROR) { - g_warning("WSAStartup() failed\n"); + g_warning("WSAStartup() failed"); return -1; } #endif @@ -290,7 +290,7 @@ gint fd_open_inet(gushort port) sock = socket(AF_INET, SOCK_STREAM, 0); if (!SOCKET_IS_VALID(sock)) { #ifdef G_OS_WIN32 - g_warning("fd_open_inet(): socket() failed: %d\n", + g_warning("fd_open_inet(): socket() failed: %d", WSAGetLastError()); #else perror("fd_open_inet(): socket"); @@ -565,7 +565,7 @@ static gint fd_check_io(gint fd, GIOCondition cond) if (FD_ISSET(fd, &fds)) { return 0; } else { - g_warning("Socket IO timeout\n"); + g_warning("Socket IO timeout"); log_error(LOG_PROTOCOL, _("Socket IO timeout.\n")); return -1; } @@ -837,7 +837,7 @@ gint sock_connect_async_cancel(gint id) g_free(conn_data->hostname); g_free(conn_data); } else { - g_warning("sock_connect_async_cancel: id %d not found.\n", id); + g_warning("sock_connect_async_cancel: id %d not found", id); return -1; } @@ -911,7 +911,7 @@ static gboolean sock_get_address_info_async_cb(GIOChannel *source, g_io_channel_set_encoding(source, NULL, &err); if (err) { - g_warning("can unset encoding: %s\n", err->message); + g_warning("can unset encoding: %s", err->message); g_error_free(err); return FALSE; } @@ -919,7 +919,7 @@ static gboolean sock_get_address_info_async_cb(GIOChannel *source, if (g_io_channel_read_chars(source, &len, sizeof(len), &bytes_read, &err) == G_IO_STATUS_NORMAL) { if (err != NULL) { - g_warning("g_io_channel_read_chars: %s\n", err->message); + g_warning("g_io_channel_read_chars: %s", err->message); g_error_free(err); return FALSE; } @@ -932,7 +932,7 @@ static gboolean sock_get_address_info_async_cb(GIOChannel *source, if (g_io_channel_read_chars(source, cur, todo, &bytes_read, &err) != G_IO_STATUS_NORMAL) { if (err) { - g_warning("canonical name not read %s\n", err->message); + g_warning("canonical name not read %s", err->message); g_free(canonical_name); canonical_name = NULL; g_error_free(err); @@ -944,7 +944,7 @@ static gboolean sock_get_address_info_async_cb(GIOChannel *source, todo -= bytes_read; } if (bytes_read == 0) { - g_warning("canonical name not read\n"); + g_warning("canonical name not read"); g_free(canonical_name); canonical_name = NULL; break; @@ -957,7 +957,7 @@ static gboolean sock_get_address_info_async_cb(GIOChannel *source, sizeof(ai_member), &bytes_read, &err) != G_IO_STATUS_NORMAL) { if (err != NULL) { - g_warning("g_io_channel_read_chars: addr len %s\n", err->message); + g_warning("g_io_channel_read_chars: addr len %s", err->message); g_error_free(err); err = NULL; break; @@ -968,7 +968,7 @@ static gboolean sock_get_address_info_async_cb(GIOChannel *source, break; if (ai_member[0] == AF_UNSPEC) { - g_warning("DNS lookup failed\n"); + g_warning("DNS lookup failed"); log_error(LOG_PROTOCOL, _("%s:%d: unknown host.\n"), lookup_data->hostname, lookup_data->port); break; @@ -979,7 +979,7 @@ static gboolean sock_get_address_info_async_cb(GIOChannel *source, &bytes_read, &err) != G_IO_STATUS_NORMAL) { if (err != NULL) { - g_warning("g_io_channel_read_chars: addr data read %s\n", err->message); + g_warning("g_io_channel_read_chars: addr data read %s", err->message); g_error_free(err); err = NULL; g_free(addr); @@ -989,7 +989,7 @@ static gboolean sock_get_address_info_async_cb(GIOChannel *source, if (bytes_read != ai_member[3]) { g_warning("sock_get_address_info_async_cb: " - "incomplete address data\n"); + "incomplete address data"); g_free(addr); break; } @@ -1059,7 +1059,7 @@ static void address_info_async_child(void *opaque) gai_err = getaddrinfo(parm->hostname, port_str, &hints, &res); if (gai_err != 0) { gchar len = 0; - g_warning("getaddrinfo for %s:%s failed: %s\n", + g_warning("getaddrinfo for %s:%s failed: %s", parm->hostname, port_str, gai_strerror(gai_err)); log_error(LOG_PROTOCOL, _("%s:%s: host lookup failed (%s).\n"), parm->hostname, port_str, gai_strerror(gai_err)); diff --git a/src/common/ssl.c b/src/common/ssl.c @@ -281,7 +281,7 @@ gnutls_x509_crt_t *ssl_get_certificate_chain(gnutls_session_t session, gint *lis gnutls_x509_crt_init(&certs[i]); r = gnutls_x509_crt_import(certs[i], &raw_cert_list[i], GNUTLS_X509_FMT_DER); if (r < 0) { - g_warning("cert get failure: %d %s\n", r, gnutls_strerror(r)); + g_warning("cert get failure: %d %s", r, gnutls_strerror(r)); result = FALSE; i--; @@ -332,7 +332,7 @@ gboolean ssl_init_socket(SockInfo *sockinfo) if (claws_ssl_get_cert_file()) { r = gnutls_certificate_set_x509_trust_file(xcred, claws_ssl_get_cert_file(), GNUTLS_X509_FMT_PEM); if (r < 0) - g_warning("Can't read SSL_CERT_FILE %s: %s\n", + g_warning("Can't read SSL_CERT_FILE '%s': %s", claws_ssl_get_cert_file(), gnutls_strerror(r)); } else { diff --git a/src/common/ssl_certificate.c b/src/common/ssl_certificate.c @@ -107,13 +107,13 @@ static gnutls_x509_crt_t x509_crt_copy(gnutls_x509_crt_t src) size = 0; if (gnutls_x509_crt_init(&dest) != 0) { - g_warning("couldn't gnutls_x509_crt_init\n"); + g_warning("couldn't gnutls_x509_crt_init"); return NULL; } if (gnutls_x509_crt_export(src, GNUTLS_X509_FMT_DER, NULL, &size) != GNUTLS_E_SHORT_MEMORY_BUFFER) { - g_warning("couldn't gnutls_x509_crt_export to get size\n"); + g_warning("couldn't gnutls_x509_crt_export to get size"); gnutls_x509_crt_deinit(dest); return NULL; } @@ -125,12 +125,12 @@ static gnutls_x509_crt_t x509_crt_copy(gnutls_x509_crt_t src) tmp.size = size; ret = gnutls_x509_crt_import(dest, &tmp, GNUTLS_X509_FMT_DER); if (ret) { - g_warning("couldn't gnutls_x509_crt_import for real (%d %s)\n", ret, gnutls_strerror(ret)); + g_warning("couldn't gnutls_x509_crt_import for real (%d %s)", ret, gnutls_strerror(ret)); gnutls_x509_crt_deinit(dest); dest = NULL; } } else { - g_warning("couldn't gnutls_x509_crt_export for real (%d %s)\n", ret, gnutls_strerror(ret)); + g_warning("couldn't gnutls_x509_crt_export for real (%d %s)", ret, gnutls_strerror(ret)); gnutls_x509_crt_deinit(dest); dest = NULL; } @@ -169,13 +169,13 @@ static void gnutls_export_X509_fp(FILE *fp, gnutls_x509_crt_t x509_cert, gnutls_ int r; if ((r = gnutls_x509_crt_export(x509_cert, format, output, &cert_size)) < 0) { - g_warning("couldn't export cert %s (%zd)\n", gnutls_strerror(r), cert_size); + g_warning("couldn't export cert %s (%zd)", gnutls_strerror(r), cert_size); return; } debug_print("writing %zd bytes\n",cert_size); if (fwrite(&output, 1, cert_size, fp) < cert_size) { - g_warning("failed to write cert: %d %s\n", errno, g_strerror(errno)); + g_warning("failed to write cert: %d %s", errno, g_strerror(errno)); } } @@ -190,7 +190,7 @@ size_t gnutls_i2d_X509(gnutls_x509_crt_t x509_cert, unsigned char **output) *output = malloc(cert_size); if ((r = gnutls_x509_crt_export(x509_cert, GNUTLS_X509_FMT_DER, *output, &cert_size)) < 0) { - g_warning("couldn't export cert %s (%zd)\n", gnutls_strerror(r), cert_size); + g_warning("couldn't export cert %s (%zd)", gnutls_strerror(r), cert_size); free(*output); *output = NULL; return 0; @@ -209,7 +209,7 @@ size_t gnutls_i2d_PrivateKey(gnutls_x509_privkey_t pkey, unsigned char **output) *output = malloc(key_size); if ((r = gnutls_x509_privkey_export(pkey, GNUTLS_X509_FMT_DER, *output, &key_size)) < 0) { - g_warning("couldn't export key %s (%zd)\n", gnutls_strerror(r), key_size); + g_warning("couldn't export key %s (%zd)", gnutls_strerror(r), key_size); free(*output); *output = NULL; return 0; @@ -478,38 +478,38 @@ static gboolean ssl_certificate_compare (SSLCertificate *cert_a, SSLCertificate if ((r = gnutls_x509_crt_export(cert_a->x509_cert, GNUTLS_X509_FMT_DER, NULL, &cert_size_a)) != GNUTLS_E_SHORT_MEMORY_BUFFER) { - g_warning("couldn't gnutls_x509_crt_export to get size a %s\n", gnutls_strerror(r)); + g_warning("couldn't gnutls_x509_crt_export to get size a %s", gnutls_strerror(r)); return FALSE; } if ((r = gnutls_x509_crt_export(cert_b->x509_cert, GNUTLS_X509_FMT_DER, NULL, &cert_size_b)) != GNUTLS_E_SHORT_MEMORY_BUFFER) { - g_warning("couldn't gnutls_x509_crt_export to get size b %s\n", gnutls_strerror(r)); + g_warning("couldn't gnutls_x509_crt_export to get size b %s", gnutls_strerror(r)); return FALSE; } output_a = g_malloc(cert_size_a); output_b = g_malloc(cert_size_b); if ((r = gnutls_x509_crt_export(cert_a->x509_cert, GNUTLS_X509_FMT_DER, output_a, &cert_size_a)) < 0) { - g_warning("couldn't gnutls_x509_crt_export a %s\n", gnutls_strerror(r)); + g_warning("couldn't gnutls_x509_crt_export a %s", gnutls_strerror(r)); g_free(output_a); g_free(output_b); return FALSE; } if ((r = gnutls_x509_crt_export(cert_b->x509_cert, GNUTLS_X509_FMT_DER, output_b, &cert_size_b)) < 0) { - g_warning("couldn't gnutls_x509_crt_export b %s\n", gnutls_strerror(r)); + g_warning("couldn't gnutls_x509_crt_export b %s", gnutls_strerror(r)); g_free(output_a); g_free(output_b); return FALSE; } if (cert_size_a != cert_size_b) { - g_warning("size differ %zd %zd\n", cert_size_a, cert_size_b); + g_warning("size differ %zd %zd", cert_size_a, cert_size_b); g_free(output_a); g_free(output_b); return FALSE; } if (memcmp(output_a, output_b, cert_size_a)) { - g_warning("contents differ\n"); + g_warning("contents differ"); g_free(output_a); g_free(output_b); return FALSE; @@ -826,7 +826,7 @@ gboolean ssl_certificate_check_chain(gnutls_x509_crt_t *certs, gint chain_len, } if (r < 0) - g_warning("Can't read SSL_CERT_FILE %s: %s\n", + g_warning("Can't read SSL_CERT_FILE '%s': %s", claws_ssl_get_cert_file(), gnutls_strerror(r)); } else { diff --git a/src/common/template.c b/src/common/template.c @@ -75,7 +75,7 @@ static Template *template_load(gchar *filename) } if (!tmpl->name) { - g_warning("wrong template format\n"); + g_warning("wrong template format"); template_free(tmpl); fclose(fp); return NULL; @@ -172,7 +172,7 @@ GSList *template_read_config(void) } if ((dir = g_dir_open(path, 0, NULL)) == NULL) { - g_warning("failed to open directory: %s\n", path); + g_warning("failed to open directory: '%s'", path); return NULL; } @@ -201,7 +201,7 @@ GSList *template_read_config(void) #define TRY(func) { \ if (!(func)) \ { \ - g_warning("Failed to write template to file\n"); \ + g_warning("Failed to write template to file"); \ if (fp) fclose(fp); \ if (new) claws_unlink(new); \ g_free(new); \ @@ -213,7 +213,7 @@ if (!(func)) \ #define TRY_NO_CLOSE(func) { \ if (!(func)) \ { \ - g_warning("Failed to write template to file\n"); \ + g_warning("Failed to write template to file"); \ if (new) claws_unlink(new); \ g_free(new); \ g_free(filename); \ @@ -235,7 +235,7 @@ static void template_write_config(GSList *tmpl_list) if (!is_dir_exist(path)) { if (is_file_exist(path)) { - g_warning("file %s already exists\n", path); + g_warning("file '%s' already exists", path); return; } if (make_dir(path) < 0) diff --git a/src/common/utils.h b/src/common/utils.h @@ -115,7 +115,7 @@ guchar *g_base64_decode_wa(const gchar *text, gsize *out_len); #define Xalloca(ptr, size, iffail) \ { \ if ((ptr = alloca(size)) == NULL) { \ - g_warning("can't allocate memory\n"); \ + g_warning("can't allocate memory"); \ iffail; \ } \ } @@ -125,7 +125,7 @@ guchar *g_base64_decode_wa(const gchar *text, gsize *out_len); gchar *__tmp; \ \ if ((__tmp = alloca(strlen(str) + 1)) == NULL) { \ - g_warning("can't allocate memory\n"); \ + g_warning("can't allocate memory"); \ iffail; \ } else \ strcpy(__tmp, str); \ @@ -138,7 +138,7 @@ guchar *g_base64_decode_wa(const gchar *text, gsize *out_len); gchar *__tmp; \ \ if ((__tmp = alloca(len + 1)) == NULL) { \ - g_warning("can't allocate memory\n"); \ + g_warning("can't allocate memory"); \ iffail; \ } else { \ strncpy(__tmp, str, len); \ @@ -156,7 +156,7 @@ guchar *g_base64_decode_wa(const gchar *text, gsize *out_len); len1 = strlen(str1); \ len2 = strlen(str2); \ if ((__tmp = alloca(len1 + len2 + 1)) == NULL) { \ - g_warning("can't allocate memory\n"); \ + g_warning("can't allocate memory"); \ iffail; \ } else { \ memcpy(__tmp, str1, len1); \ diff --git a/src/common/xml.c b/src/common/xml.c @@ -127,7 +127,7 @@ static GNode *xml_build_tree(XMLFile *file, GNode *parent, guint level) while (xml_parse_next_tag(file) == 0) { if (file->level < level) break; if (file->level == level) { - g_warning("xml_build_tree(): Parse error\n"); + g_warning("xml_build_tree(): Parse error"); break; } @@ -192,7 +192,7 @@ gint xml_get_dtd(XMLFile *file) file->need_codeconv = FALSE; } } else { - g_warning("Can't get xml dtd\n"); + g_warning("Can't get XML DTD"); return -1; } @@ -215,7 +215,7 @@ next: } if (xml_get_parenthesis(file, buf, sizeof(buf)) < 0) { - g_warning("xml_parse_next_tag(): Can't parse next tag\n"); + g_warning("xml_parse_next_tag(): Can't parse next tag"); return -1; } @@ -224,7 +224,7 @@ next: /* end-tag */ if (buf[0] == '/') { if (strcmp(xml_get_current_tag(file)->tag, buf + 1) != 0) { - g_warning("xml_parse_next_tag(): Tag name mismatch: %s (%s)\n", buf, xml_get_current_tag(file)->tag); + g_warning("xml_parse_next_tag(): Tag name mismatch: %s (%s)", buf, xml_get_current_tag(file)->tag); return -1; } xml_pop_tag(file); @@ -246,7 +246,7 @@ next: } if (strlen(buf) == 0) { - g_warning("xml_parse_next_tag(): Tag name is empty\n"); + g_warning("xml_parse_next_tag(): Tag name is empty"); return -1; } @@ -288,7 +288,7 @@ next: while (g_ascii_isspace(*bufp)) bufp++; attr_name = bufp; if ((p = strchr(attr_name, '=')) == NULL) { - g_warning("xml_parse_next_tag(): Syntax error in tag (a) %s\n", attr_name); + g_warning("xml_parse_next_tag(): Syntax error in tag (a) %s", attr_name); return -1; } bufp = p; @@ -296,14 +296,14 @@ next: while (g_ascii_isspace(*bufp)) bufp++; if (*bufp != '"' && *bufp != '\'') { - g_warning("xml_parse_next_tag(): Syntax error in tag (b) %s\n", bufp); + g_warning("xml_parse_next_tag(): Syntax error in tag (b) %s", bufp); return -1; } quote = *bufp; bufp++; attr_value = bufp; if ((p = strchr(attr_value, quote)) == NULL) { - g_warning("xml_parse_next_tag(): Syntax error in tag (c) %s\n", attr_value); + g_warning("xml_parse_next_tag(): Syntax error in tag (c) %s", attr_value); return -1; } bufp = p; @@ -539,7 +539,7 @@ static gint xml_unescape_str(gchar *str) while ((start = strchr(p, '&')) != NULL) { if ((end = strchr(start + 1, ';')) == NULL) { - g_warning("Unescaped '&' appeared\n"); + g_warning("Unescaped '&' appeared"); p = start + 1; continue; } @@ -683,7 +683,7 @@ static gint xml_get_parenthesis(XMLFile *file, gchar *buf, gint len) #define TRY(func) \ if (!(func)) \ { \ - g_warning("failed to write part of xml tree\n"); \ + g_warning("failed to write part of XML tree"); \ return -1; \ } \ diff --git a/src/compose.c b/src/compose.c @@ -899,7 +899,7 @@ static void compose_create_tags(GtkTextView *text, Compose *compose) for (i = 0; i < 8; i++) { if (success[i] == FALSE) { - g_warning("Compose: color allocation failed.\n"); + g_warning("Compose: color allocation failed."); quote_color1 = quote_color2 = quote_color3 = quote_bgcolor1 = quote_bgcolor2 = quote_bgcolor3 = signature_color = uri_color = black; @@ -1443,7 +1443,7 @@ static Compose *compose_reply_mode(ComposeMode mode, GSList *msginfo_list, gchar compose = compose_redirect(NULL, msginfo, FALSE); break; default: - g_warning("compose_reply_mode(): invalid Compose Mode: %d\n", mode); + g_warning("compose_reply_mode(): invalid Compose Mode: %d", mode); } if (compose == NULL) { @@ -1833,7 +1833,7 @@ Compose *compose_forward(PrefsAccount *account, MsgInfo *msginfo, msgfile = procmsg_get_message_file(msginfo); if (!is_file_exist(msgfile)) - g_warning("%s: file not exist\n", msgfile); + g_warning("%s: file does not exist", msgfile); else compose_attach_append(compose, msgfile, msgfile, "message/rfc822", NULL); @@ -2024,7 +2024,7 @@ static Compose *compose_forward_multiple(PrefsAccount *account, GSList *msginfo_ msgfile = procmsg_get_message_file((MsgInfo *)msginfo->data); if (!is_file_exist(msgfile)) - g_warning("%s: file not exist\n", msgfile); + g_warning("%s: file does not exist", msgfile); else compose_attach_append(compose, msgfile, msgfile, "message/rfc822", NULL); @@ -2415,7 +2415,7 @@ Compose *compose_reedit(MsgInfo *msginfo, gboolean batch) fp = procmime_get_first_text_content(msginfo); } if (fp == NULL) { - g_warning("Can't get text part\n"); + g_warning("Can't get text part"); } if (fp != NULL) { @@ -4144,7 +4144,7 @@ static gboolean compose_get_line_break_pos(GtkTextBuffer *buffer, if (len == 0) { g_free(str); - g_warning("compose_get_line_break_pos: len = 0!\n"); + g_warning("compose_get_line_break_pos: len = 0!"); return FALSE; } @@ -4339,7 +4339,7 @@ static gboolean compose_join_next_line(Compose *compose, last->bp = (bp_); last->ep = (ep_); last->pti = (pti_); \ last->next = NULL; \ } else { \ - g_warning("alloc error scanning URIs\n"); \ + g_warning("alloc error scanning URIs"); \ } static gboolean compose_beautify_paragraph(Compose *compose, GtkTextIter *par_iter, gboolean force) @@ -4818,7 +4818,7 @@ compose_current_mail_account(void) \ len = strlen(str) + 3; \ if ((__tmp = alloca(len)) == NULL) { \ - g_warning("can't allocate memory\n"); \ + g_warning("can't allocate memory"); \ g_string_free(header, TRUE); \ return NULL; \ } \ @@ -4828,7 +4828,7 @@ compose_current_mail_account(void) gchar *__tmp; \ \ if ((__tmp = alloca(strlen(str) + 1)) == NULL) { \ - g_warning("can't allocate memory\n"); \ + g_warning("can't allocate memory"); \ g_string_free(header, TRUE); \ return NULL; \ } else \ @@ -4846,7 +4846,7 @@ compose_current_mail_account(void) \ len = strlen(str) + 3; \ if ((__tmp = alloca(len)) == NULL) { \ - g_warning("can't allocate memory\n"); \ + g_warning("can't allocate memory"); \ errret; \ } \ g_snprintf(__tmp, len, "\"%s\"", str); \ @@ -4855,7 +4855,7 @@ compose_current_mail_account(void) gchar *__tmp; \ \ if ((__tmp = alloca(strlen(str) + 1)) == NULL) { \ - g_warning("can't allocate memory\n"); \ + g_warning("can't allocate memory"); \ errret; \ } else \ strcpy(__tmp, str); \ @@ -5768,10 +5768,10 @@ static gint compose_write_to_file(Compose *compose, FILE *fp, gint action, gbool procmsg_save_to_outbox(outbox, tmp_enc_file, TRUE); claws_unlink(tmp_enc_file); } else { - g_warning("Can't open file %s\n", tmp_enc_file); + g_warning("Can't open file '%s'", tmp_enc_file); } } else { - g_warning("couldn't get tempfile\n"); + g_warning("couldn't get tempfile"); } } if (!privacy_encrypt(compose->privacy_system, mimemsg, compose->encdata)) { @@ -5806,7 +5806,7 @@ static gint compose_write_body_to_file(Compose *compose, const gchar *file) /* chmod for security */ if (change_file_mode_rw(fp, file) < 0) { FILE_OP_ERROR(file, "chmod"); - g_warning("can't change file mode\n"); + g_warning("can't change file mode"); } buffer = gtk_text_view_get_buffer(GTK_TEXT_VIEW(compose->text)); @@ -5862,7 +5862,7 @@ static gint compose_remove_reedit_target(Compose *compose, gboolean force) folder_has_parent_of_type(item, F_DRAFT) || msginfo == compose->autosaved_draft)) { if (folder_item_remove_msg(item, msginfo->msgnum) < 0) { - g_warning("can't remove the old message\n"); + g_warning("can't remove the old message"); return -1; } else { debug_print("removed reedit target %d\n", msginfo->msgnum); @@ -5974,7 +5974,7 @@ static gint compose_queue_sub(Compose *compose, gint *msgnum, FolderItem **item, if (change_file_mode_rw(fp, tmp) < 0) { FILE_OP_ERROR(tmp, "chmod"); - g_warning("can't change file mode\n"); + g_warning("can't change file mode"); } /* queueing variables */ @@ -6122,7 +6122,7 @@ static gint compose_queue_sub(Compose *compose, gint *msgnum, FolderItem **item, } } if (err == TRUE) { - g_warning("failed to write queue message\n"); + g_warning("failed to write queue message"); fclose(fp); claws_unlink(tmp); g_free(tmp); @@ -6141,14 +6141,14 @@ static gint compose_queue_sub(Compose *compose, gint *msgnum, FolderItem **item, queue = account_get_special_folder(compose->account, F_QUEUE); } if (!queue) { - g_warning("can't find queue folder\n"); + g_warning("can't find queue folder"); claws_unlink(tmp); g_free(tmp); return -1; } folder_item_scan(queue); if ((num = folder_item_add_msg(queue, tmp, NULL, FALSE)) < 0) { - g_warning("can't queue the message\n"); + g_warning("can't queue the message"); claws_unlink(tmp); g_free(tmp); return -1; @@ -9374,7 +9374,7 @@ static gint compose_exec_ext_editor_real(const gchar *file) g_snprintf(buf, sizeof(buf), prefs_common_get_ext_editor_cmd(), file); } else { if (prefs_common_get_ext_editor_cmd()) - g_warning("External editor command-line is invalid: '%s'\n", + g_warning("External editor command-line is invalid: '%s'", prefs_common_get_ext_editor_cmd()); g_snprintf(buf, sizeof(buf), DEFAULT_EDITOR_CMD, file); } @@ -9417,9 +9417,8 @@ static gboolean compose_ext_editor_kill(Compose *compose) if (kill(pgid, SIGTERM) < 0) perror("kill"); waitpid(compose->exteditor_pid, NULL, 0); - g_warning("Terminated process group id: %d", -pgid); - g_warning("Temporary file: %s", - compose->exteditor_file); + g_warning("Terminated process group id: %d. " + "Temporary file: %s", -pgid, compose->exteditor_file); compose_set_ext_editor_sensitive(compose, TRUE); @@ -9473,13 +9472,13 @@ static gboolean compose_input_cb(GIOChannel *source, GIOCondition condition, compose->modified = TRUE; g_free(chars); } else if (buf[0] == '1') { /* failed */ - g_warning("Couldn't exec external editor\n"); + g_warning("Couldn't exec external editor"); if (claws_unlink(compose->exteditor_file) < 0) FILE_OP_ERROR(compose->exteditor_file, "unlink"); } else if (buf[0] == '2') { - g_warning("Couldn't write to file\n"); + g_warning("Couldn't write to file"); } else if (buf[0] == '3') { - g_warning("Pipe read failed\n"); + g_warning("Pipe read failed"); } compose_set_ext_editor_sensitive(compose, TRUE); @@ -9929,7 +9928,7 @@ gboolean compose_draft (gpointer data, guint action) /* chmod for security */ if (change_file_mode_rw(fp, tmp) < 0) { FILE_OP_ERROR(tmp, "chmod"); - g_warning("can't change file mode\n"); + g_warning("can't change file mode"); } /* Save draft infos */ diff --git a/src/enriched.c b/src/enriched.c @@ -120,7 +120,7 @@ static ERTFState ertf_read_line(ERTFParser *parser) } if (conv_convert(parser->conv, buf2, sizeof(buf2), buf) < 0) { - g_warning("ertf_read_line(): code conversion failed\n"); + g_warning("ertf_read_line(): code conversion failed"); index = parser->bufp - parser->buf->str; diff --git a/src/etpan/etpan-ssl.c b/src/etpan/etpan-ssl.c @@ -55,7 +55,7 @@ gboolean etpan_certificate_check(mailstream *stream, const char *host, gint port len = (int)mailstream_ssl_get_certificate(stream, &cert_der); if (cert_der == NULL || len < 0) { - g_warning("no cert presented.\n"); + g_warning("no cert presented"); return FALSE; } @@ -68,7 +68,7 @@ gboolean etpan_certificate_check(mailstream *stream, const char *host, gint port if (gnutls_x509_crt_import(cert, &tmp, GNUTLS_X509_FMT_DER) < 0) { free(tmp.data); - g_warning("IMAP: can't get cert\n"); + g_warning("IMAP: can't get cert"); return FALSE; } else if (ssl_certificate_check(cert, (guint)-1, host, port, accept_if_valid) == TRUE) { free(tmp.data); diff --git a/src/export.c b/src/export.c @@ -212,7 +212,7 @@ static void export_ok_cb(GtkWidget *widget, gpointer data) mbox = g_filename_from_utf8(utf8mbox, -1, NULL, NULL, NULL); if (!mbox) { - g_warning("export_ok_cb(): failed to convert character set.\n"); + g_warning("export_ok_cb(): failed to convert character set."); mbox = g_strdup(utf8mbox); } diff --git a/src/filtering.c b/src/filtering.c @@ -479,11 +479,11 @@ static gboolean filteringaction_apply(FilteringAction * action, MsgInfo * info) #ifndef USE_NEW_ADDRBOOK if (!addressbook_peek_folder_exists(action->destination, &book, &folder)) { - g_warning("addressbook folder not found '%s'\n", action->destination?action->destination:"(null)"); + g_warning("addressbook folder not found '%s'", action->destination?action->destination:"(null)"); return FALSE; } if (!book) { - g_warning("addressbook_peek_folder_exists returned NULL book\n"); + g_warning("addressbook_peek_folder_exists returned NULL book"); return FALSE; } @@ -524,7 +524,7 @@ static gboolean filteringaction_apply(FilteringAction * action, MsgInfo * info) #else if (!addressadd_selection(name, stripped_addr, NULL, NULL)) { #endif - g_warning("contact could not be added\n"); + g_warning("contact could not be added"); errors++; } g_free(name); @@ -538,7 +538,7 @@ static gboolean filteringaction_apply(FilteringAction * action, MsgInfo * info) g_slist_free(address_list); end_address_completion(); } else { - g_warning("header '%s' not set or empty\n", action->header?action->header:"(null)"); + g_warning("header '%s' not set or empty", action->header?action->header:"(null)"); } return (errors == 0); } diff --git a/src/folder.c b/src/folder.c @@ -302,7 +302,7 @@ void folder_set_xml(Folder *folder, XMLTag *tag) account = account_find_from_id(atoi(attr->value)); if (!account) - g_warning("account_id: %s not found\n", attr->value); + g_warning("account_id: %s not found", attr->value); else { folder->account = account; account->folder = folder; @@ -637,7 +637,7 @@ void folder_item_set_xml(Folder *folder, FolderItem *item, XMLTag *tag) account = account_find_from_id(atoi(attr->value)); if (!account) - g_warning("account_id: %s not found\n", attr->value); + g_warning("account_id: %s not found", attr->value); else item->account = account; } else if (!strcmp(attr->name, "apply_sub")) { @@ -833,7 +833,7 @@ gint folder_read_list(void) xmlnode = node->data; if (strcmp2(xmlnode->tag->tag, "folderlist") != 0) { - g_warning("wrong folder list\n"); + g_warning("wrong folder list"); xml_free_tree(node); return -1; } @@ -874,7 +874,7 @@ void folder_write_list(void) if (xml_file_put_xml_decl(pfile->fp) < 0) { prefs_file_close_revert(pfile); - g_warning("failed to start write folder list.\n"); + g_warning("failed to start write folder list."); return; } tag = xml_tag_new("folderlist"); @@ -900,9 +900,9 @@ void folder_write_list(void) if (xml_write_tree(rootnode, pfile->fp) < 0) { prefs_file_close_revert(pfile); - g_warning("failed to write folder list.\n"); + g_warning("failed to write folder list."); } else if (prefs_file_close(pfile) < 0) { - g_warning("failed to write folder list.\n"); + g_warning("failed to write folder list."); } xml_free_tree(rootnode); } @@ -1848,7 +1848,7 @@ void folder_set_missing_folders(void) continue; if (folder->klass->create_tree(folder) < 0) { - g_warning("%s: can't create the folder tree.\n", + g_warning("%s: can't create the folder tree.", LOCAL_FOLDER(folder)->rootpath); continue; } @@ -4043,7 +4043,7 @@ static gpointer xml_to_folder_item(gpointer nodedata, gpointer data) cm_return_val_if_fail(folder != NULL, NULL); if (strcmp2(xmlnode->tag->tag, "folderitem") != 0) { - g_warning("tag name != \"folderitem\"\n"); + g_warning("tag name != \"folderitem\""); return NULL; } @@ -4090,7 +4090,7 @@ static Folder *folder_get_from_xml(GNode *node) xmlnode = node->data; if (strcmp2(xmlnode->tag->tag, "folder") != 0) { - g_warning("tag name != \"folder\"\n"); + g_warning("tag name != \"folder\""); return NULL; } list = xmlnode->tag->attr; diff --git a/src/folderview.c b/src/folderview.c @@ -1746,7 +1746,7 @@ static void set_special_folder(GtkCMCTree *ctree, FolderItem *item, node = gtk_cmctree_find_by_row_data(ctree, root, item); if (!node) - g_warning("%s not found.\n", item->path); + g_warning("%s not found.", item->path); else { parent = GTK_CMCTREE_ROW(node)->parent; if (*prev && parent == GTK_CMCTREE_ROW(*prev)->parent) @@ -2800,7 +2800,7 @@ static void folderview_drag_data_get(GtkWidget *widget, source, strlen(source)); } } else { - g_warning("unknown info %d\n", info); + g_warning("unknown info %d", info); } } diff --git a/src/gtk/about.c b/src/gtk/about.c @@ -633,7 +633,7 @@ static GtkWidget *about_create_child_page_release_notes(void) tmp = conv_codeset_strdup(buf, src_codeset, dest_codeset); if (!tmp) { - g_warning("Failed to convert character set of action configuration\n"); + g_warning("Failed to convert character set of action configuration"); tmp = g_strdup(buf); } diff --git a/src/gtk/gtkutils.c b/src/gtk/gtkutils.c @@ -451,7 +451,7 @@ static gboolean gtkut_text_buffer_find(GtkTextBuffer *buffer, const GtkTextIter wcs = g_utf8_to_ucs4(str, -1, &items_read, &items_written, &error); if (error != NULL) { - g_warning("An error occurred while converting a string from UTF-8 to UCS-4: %s\n", + g_warning("An error occurred while converting a string from UTF-8 to UCS-4: %s", error->message); g_error_free(error); } @@ -487,7 +487,7 @@ static gboolean gtkut_text_buffer_find_backward(GtkTextBuffer *buffer, wcs = g_utf8_to_ucs4(str, -1, &items_read, &items_written, &error); if (error != NULL) { - g_warning("An error occurred while converting a string from UTF-8 to UCS-4: %s\n", + g_warning("An error occurred while converting a string from UTF-8 to UCS-4: %s", error->message); g_error_free(error); } @@ -1087,7 +1087,7 @@ GtkWidget *xface_get_from_header(const gchar *o_xface) xface[sizeof(xface) - 1] = '\0'; if (uncompface(xface) < 0) { - g_warning("uncompface failed\n"); + g_warning("uncompface failed"); return NULL; } @@ -1131,7 +1131,7 @@ GtkWidget *face_get_from_header(const gchar *o_face) if (!gdk_pixbuf_loader_write (loader, face_png, pngsize, &error) || !gdk_pixbuf_loader_close (loader, &error)) { - g_warning("loading face failed\n"); + g_warning("loading face failed"); g_object_unref(loader); g_free(face_png); return NULL; @@ -1144,7 +1144,7 @@ GtkWidget *face_get_from_header(const gchar *o_face) if ((gdk_pixbuf_get_width(pixbuf) != 48) || (gdk_pixbuf_get_height(pixbuf) != 48)) { g_object_unref(pixbuf); - g_warning("wrong_size\n"); + g_warning("wrong_size"); return NULL; } @@ -1250,7 +1250,7 @@ GtkWidget *gtkut_get_link_btn(GtkWidget *window, const gchar *url, const gchar * gtk_widget_set_style(btn_label, style); #if !GTK_CHECK_VERSION(3, 0, 0) } else - g_warning("color allocation failed\n"); + g_warning("color allocation failed"); #endif g_signal_connect(G_OBJECT(btn), "enter", diff --git a/src/gtk/logwindow.c b/src/gtk/logwindow.c @@ -189,7 +189,7 @@ void log_window_init(LogWindow *logwin) if (success[i] == FALSE) { GtkStyle *style; - g_warning("LogWindow: color allocation failed\n"); + g_warning("LogWindow: color allocation failed"); style = gtk_widget_get_style(logwin->window); logwin->msg_color = logwin->warn_color = logwin->error_color = logwin->in_color = diff --git a/src/html.c b/src/html.c @@ -572,7 +572,7 @@ static SC_HTMLTag *sc_html_get_tag(const gchar *str) tmpp++; attr_value = tmpp; if ((p = strchr(attr_value, quote)) == NULL) { - g_warning("sc_html_get_tag(): syntax error in tag: '%s'\n", str); + g_warning("sc_html_get_tag(): syntax error in tag: '%s'", str); return tag; } tmpp = p; diff --git a/src/imap.c b/src/imap.c @@ -1577,7 +1577,7 @@ static gchar *imap_fetch_msg_full(Folder *folder, FolderItem *item, gint uid, ok = imap_select(session, IMAP_FOLDER(folder), item, NULL, NULL, NULL, NULL, NULL, FALSE); if (ok != MAILIMAP_NO_ERROR) { - g_warning("can't select mailbox %s\n", item->path); + g_warning("can't select mailbox %s", item->path); g_free(filename); return NULL; } @@ -1588,7 +1588,7 @@ static gchar *imap_fetch_msg_full(Folder *folder, FolderItem *item, gint uid, ok = imap_cmd_fetch(session, (guint32)uid, filename, headers, body); if (ok != MAILIMAP_NO_ERROR) { - g_warning("can't fetch message %d\n", uid); + g_warning("can't fetch message %d", uid); g_free(filename); return NULL; } @@ -1752,7 +1752,7 @@ static gint imap_add_msgs(Folder *folder, FolderItem *dest, GSList *file_list, &new_uid); if (ok != MAILIMAP_NO_ERROR) { - g_warning("can't append message %s\n", real_file); + g_warning("can't append message %s", real_file); g_free(real_file); g_free(destdir); statusbar_progress_all(0,0,0); @@ -1872,7 +1872,7 @@ static gint imap_do_copy_msgs(Folder *folder, FolderItem *dest, msginfo = (MsgInfo *)msglist->data; src = msginfo->folder; if (!same_dest_ok && src == dest) { - g_warning("the src folder is identical to the dest.\n"); + g_warning("the src folder is identical to the dest."); return -1; } @@ -2987,12 +2987,12 @@ static FolderItem *imap_create_special_folder(Folder *folder, new_item = imap_create_folder(folder, item, name); if (!new_item) { - g_warning("Can't create '%s'\n", name); + g_warning("Can't create '%s'", name); if (!folder->inbox) return NULL; new_item = imap_create_folder(folder, folder->inbox, name); if (!new_item) - g_warning("Can't create '%s' under INBOX\n", name); + g_warning("Can't create '%s' under INBOX", name); else new_item->stype = stype; } else @@ -3447,7 +3447,7 @@ static gint imap_remove_folder_real(Folder *folder, FolderItem *item) g_free(path); cache_dir = folder_item_get_path(item); if (is_dir_exist(cache_dir) && remove_dir_recursive(cache_dir) < 0) - g_warning("can't remove directory '%s'\n", cache_dir); + g_warning("can't remove directory '%s'", cache_dir); g_free(cache_dir); folder_item_remove(item); return 0; @@ -4034,7 +4034,7 @@ static gint imap_status(IMAPSession *session, IMAPFolder *folder, mailimap_mailbox_data_status_free(data_status); if (got_values != mask) { - g_warning("status: incomplete values received (%d)\n", got_values); + g_warning("status: incomplete values received (%d)", got_values); } return MAILIMAP_NO_ERROR; } @@ -4450,7 +4450,7 @@ static gboolean imap_rename_folder_func(GNode *node, gpointer data) gint ok = MAILIMAP_NO_ERROR; oldpathlen = strlen(oldpath); if (strncmp(oldpath, item->path, oldpathlen) != 0) { - g_warning("path doesn't match: %s, %s\n", oldpath, item->path); + g_warning("path doesn't match: %s, %s", oldpath, item->path); return TRUE; } @@ -5437,7 +5437,7 @@ static gboolean process_flags(gpointer key, gpointer value, gpointer user_data) ok = imap_set_message_flags(session, IMAP_FOLDER_ITEM(item), data->msglist, flags_value, NULL, flags_set); } else { - g_warning("can't select mailbox %s\n", item->path); + g_warning("can't select mailbox %s", item->path); } if (!is_fatal(ok)) @@ -5480,7 +5480,7 @@ static gboolean process_tags(gpointer key, gpointer value, gpointer user_data) ok = imap_set_message_flags(session, IMAP_FOLDER_ITEM(item), data->msglist, 0, &list, tags_set); } else { - g_warning("can't select mailbox %s\n", item->path); + g_warning("can't select mailbox %s", item->path); } if (!is_fatal(ok)) diff --git a/src/import.c b/src/import.c @@ -214,7 +214,7 @@ static void import_ok_cb(GtkWidget *widget, gpointer data) mbox = g_filename_from_utf8(utf8mbox, -1, NULL, NULL, NULL); if (!mbox) { - g_warning("import_ok_cb(): failed to convert character set.\n"); + g_warning("import_ok_cb(): failed to convert character set."); mbox = g_strdup(utf8mbox); } diff --git a/src/main.c b/src/main.c @@ -629,7 +629,7 @@ static void sc_session_manager_connect(MainWindow *mainwin) 256, error_string_ret); if (error_string_ret[0] || mainwin->smc_conn == NULL) - g_warning ("While connecting to session manager:\n%s.", + g_warning ("While connecting to session manager: %s.", error_string_ret); else { SmPropValue *vals; @@ -2444,7 +2444,7 @@ static GPtrArray *get_folder_item_list(gint sock) if (item) { g_ptr_array_add(folders, item); } else { - g_warning("no such folder: %s\n", buf); + g_warning("no such folder: %s", buf); } } diff --git a/src/mainwindow.c b/src/mainwindow.c @@ -989,7 +989,7 @@ static void mainwindow_colorlabel_menu_item_activate_item_cb(GtkMenuItem *menu_i } } } else - g_warning("invalid number of color elements (%d)\n", n); + g_warning("invalid number of color elements (%d)", n); g_slist_free(sel); /* reset "dont_toggle" state */ @@ -2102,7 +2102,7 @@ MainWindow *main_window_create() gdk_colormap_alloc_colors(colormap, color, 4, FALSE, TRUE, success); for (i = 0; i < 4; i++) { if (success[i] == FALSE) - g_warning("MainWindow: color allocation %d failed\n", i); + g_warning("MainWindow: color allocation %d failed", i); } #endif @@ -4282,8 +4282,7 @@ static void addressbook_open_cb(GtkAction *action, gpointer data) addressbook_dbus_open(FALSE, &error); if (error) { - g_warning("Failed to open address book"); - g_warning("%s", error->message); + g_warning("Failed to open address book: %s", error->message); g_error_free(error); } #endif diff --git a/src/matcher.c b/src/matcher.c @@ -2536,7 +2536,7 @@ void prefs_matcher_write_config(void) MATCHER_RC, NULL); if ((pfile = prefs_write_open(rcpath)) == NULL) { - g_warning("failed to write configuration to file\n"); + g_warning("failed to write configuration to file"); g_free(rcpath); return; } @@ -2544,10 +2544,10 @@ void prefs_matcher_write_config(void) g_free(rcpath); if (prefs_matcher_save(pfile->fp) < 0) { - g_warning("failed to write configuration to file\n"); + g_warning("failed to write configuration to file"); prefs_file_close_revert(pfile); } else if (prefs_file_close(pfile) < 0) { - g_warning("failed to save configuration to file\n"); + g_warning("failed to save configuration to file"); } } diff --git a/src/matcher_parser_parse.y b/src/matcher_parser_parse.y @@ -296,7 +296,7 @@ void matcher_parsererror(char *str) } cond = NULL; if (!disable_warnings) - g_warning("filtering parsing: %i: %s\n", + g_warning("filtering parsing: %i: %s", matcher_parserlineno, str); error = 1; } diff --git a/src/mbox.c b/src/mbox.c @@ -73,7 +73,7 @@ { \ lines++; \ if (fputs(s, tmp_fp) == EOF) { \ - g_warning("can't write to temporary file\n"); \ + g_warning("can't write to temporary file"); \ fclose(tmp_fp); \ fclose(mbox_fp); \ claws_unlink(tmp_file); \ @@ -111,14 +111,14 @@ gint proc_mbox(FolderItem *dest, const gchar *mbox, gboolean apply_filter, /* ignore empty lines on the head */ do { if (fgets(buf, sizeof(buf), mbox_fp) == NULL) { - g_warning("can't read mbox file.\n"); + g_warning("can't read mbox file."); fclose(mbox_fp); return -1; } } while (buf[0] == '\n' || buf[0] == '\r'); if (strncmp(buf, "From ", 5) != 0) { - g_warning("invalid mbox format: %s\n", mbox); + g_warning("invalid mbox format: %s", mbox); fclose(mbox_fp); return -1; } @@ -149,7 +149,7 @@ gint proc_mbox(FolderItem *dest, const gchar *mbox, gboolean apply_filter, if ((tmp_fp = g_fopen(tmp_file, "wb")) == NULL) { FILE_OP_ERROR(tmp_file, "fopen"); - g_warning("can't open temporary file\n"); + g_warning("can't open temporary file"); fclose(mbox_fp); g_free(tmp_file); return -1; @@ -223,7 +223,7 @@ gint proc_mbox(FolderItem *dest, const gchar *mbox, gboolean apply_filter, /* warn if email part is empty (it's the minimum check we can do */ if (lines == 0) { - g_warning("malformed mbox: %s: message %d is empty\n", mbox, msgs); + g_warning("malformed mbox: %s: message %d is empty", mbox, msgs); fclose(tmp_fp); fclose(mbox_fp); claws_unlink(tmp_file); @@ -232,7 +232,7 @@ gint proc_mbox(FolderItem *dest, const gchar *mbox, gboolean apply_filter, if (fclose(tmp_fp) == EOF) { FILE_OP_ERROR(tmp_file, "fclose"); - g_warning("can't write to temporary file\n"); + g_warning("can't write to temporary file"); fclose(mbox_fp); claws_unlink(tmp_file); g_free(tmp_file); @@ -321,8 +321,7 @@ gint lock_mbox(const gchar *base, LockType type) lockfile = g_strdup_printf("%s.%d", base, getpid()); if ((lockfp = g_fopen(lockfile, "wb")) == NULL) { FILE_OP_ERROR(lockfile, "fopen"); - g_warning("can't create lock file %s\n", lockfile); - g_warning("use 'flock' instead of 'file' if possible.\n"); + g_warning("can't create lock file '%s', use 'flock' instead of 'file' if possible.", lockfile); g_free(lockfile); return -1; } @@ -344,14 +343,14 @@ gint lock_mbox(const gchar *base, LockType type) while (link(lockfile, locklink) < 0) { FILE_OP_ERROR(lockfile, "link"); if (retry >= 5) { - g_warning("can't create %s\n", lockfile); + g_warning("can't create '%s'", lockfile); claws_unlink(lockfile); g_free(lockfile); return -1; } if (retry == 0) g_warning("mailbox is owned by another" - " process, waiting...\n"); + " process, waiting..."); retry++; sleep(5); } @@ -398,14 +397,14 @@ gint lock_mbox(const gchar *base, LockType type) { #endif #endif /* HAVE_FLOCK */ - g_warning("can't lock %s\n", base); + g_warning("can't lock %s", base); if (close(lockfd) < 0) perror("close"); return -1; } retval = lockfd; } else { - g_warning("invalid lock type\n"); + g_warning("invalid lock type"); return -1; } @@ -455,7 +454,7 @@ gint unlock_mbox(const gchar *base, gint fd, LockType type) { #endif #endif /* HAVE_FLOCK */ - g_warning("can't unlock %s\n", base); + g_warning("can't unlock %s", base); if (close(fd) < 0) perror("close"); return -1; @@ -469,7 +468,7 @@ gint unlock_mbox(const gchar *base, gint fd, LockType type) return 0; } - g_warning("invalid lock type\n"); + g_warning("invalid lock type"); return -1; } @@ -492,7 +491,7 @@ gint copy_mbox(gint srcfd, const gchar *dest) if (change_file_mode_rw(dest_fp, dest) < 0) { FILE_OP_ERROR(dest, "chmod"); - g_warning("can't change file mode\n"); + g_warning("can't change file mode"); } while ((n_read = read(srcfd, buf, sizeof(buf))) > 0) { @@ -501,7 +500,7 @@ gint copy_mbox(gint srcfd, const gchar *dest) break; } if (fwrite(buf, 1, n_read, dest_fp) < n_read) { - g_warning("writing to %s failed.\n", dest); + g_warning("writing to %s failed.", dest); fclose(dest_fp); claws_unlink(dest); return -1; @@ -509,7 +508,7 @@ gint copy_mbox(gint srcfd, const gchar *dest) } if (save_errno != 0) { - g_warning("error %d reading mbox: %s\n", save_errno, + g_warning("error %d reading mbox: %s", save_errno, g_strerror(save_errno)); err = TRUE; } @@ -533,7 +532,7 @@ void empty_mbox(const gchar *mbox) if ((fp = g_fopen(mbox, "wb")) == NULL) { FILE_OP_ERROR(mbox, "fopen"); - g_warning("can't truncate mailbox to zero.\n"); + g_warning("can't truncate mailbox to zero."); return; } fclose(fp); diff --git a/src/messageview.c b/src/messageview.c @@ -904,7 +904,7 @@ static gint disposition_notification_send(MsgInfo *msginfo) /* chmod for security */ if (change_file_mode_rw(fp, tmp) < 0) { FILE_OP_ERROR(tmp, "chmod"); - g_warning("can't change file mode\n"); + g_warning("can't change file mode"); } addr = g_strdup(to); @@ -1081,13 +1081,13 @@ static gint disposition_notification_send(MsgInfo *msginfo) queue = account_get_special_folder(account, F_QUEUE); if (!queue) queue = folder_get_default_queue(); if (!queue) { - g_warning("can't find queue folder\n"); + g_warning("can't find queue folder"); claws_unlink(tmp); return -1; } folder_item_scan(queue); if ((num = folder_item_add_msg(queue, tmp, NULL, TRUE)) < 0) { - g_warning("can't queue the message\n"); + g_warning("can't queue the message"); claws_unlink(tmp); return -1; } @@ -1329,7 +1329,7 @@ gint messageview_show(MessageView *messageview, MsgInfo *msginfo, statuswindow_pop_all(); if (!file) { - g_warning("can't get message file path.\n"); + g_warning("can't get message file path."); textview_show_error(messageview->mimeview->textview); return -1; } @@ -1965,7 +1965,7 @@ static void return_receipt_send_clicked(NoticeView *noticeview, MsgInfo *msginfo file = procmsg_get_message_file_path(msginfo); if (!file) { - g_warning("can't get message file path.\n"); + g_warning("can't get message file path."); return; } @@ -2842,8 +2842,7 @@ static void addressbook_open_cb(GtkAction *action, gpointer data) addressbook_dbus_open(FALSE, &error); if (error) { - g_warning("Failed to open address book"); - g_warning("%s", error->message); + g_warning("Failed to open address book: %s", error->message); g_error_free(error); } #endif diff --git a/src/mh.c b/src/mh.c @@ -496,7 +496,7 @@ static gint mh_copy_msgs(Folder *folder, FolderItem *dest, MsgInfoList *msglist, cm_return_val_if_fail(msginfo != NULL, -1); if (msginfo->folder == dest) { - g_warning("the src folder is identical to the dest.\n"); + g_warning("the src folder is identical to the dest."); return -1; } @@ -590,7 +590,7 @@ static gint mh_copy_msgs(Folder *folder, FolderItem *dest, MsgInfoList *msglist, } if (relation) { if (g_hash_table_lookup(relation, msginfo) != NULL) - g_warning("already in : %p", msginfo); + g_warning("already in: %p", msginfo); g_hash_table_insert(relation, msginfo, GINT_TO_POINTER(dest->last_num+1)); } @@ -777,7 +777,7 @@ static gint mh_scan_tree(Folder *folder) { \ if (!is_dir_exist(dir)) { \ if (is_file_exist(dir)) { \ - g_warning("File `%s' already exists.\n" \ + g_warning("File '%s' already exists. " \ "Can't create folder.", dir); \ return -1; \ } \ @@ -1032,7 +1032,7 @@ static gint mh_remove_folder(Folder *folder, FolderItem *item) path = folder_item_get_path(item); if ((ret = remove_dir_recursive(path)) < 0) { - g_warning("can't remove directory `%s'\n", path); + g_warning("can't remove directory '%s'", path); g_free(path); return ret; } @@ -1117,7 +1117,7 @@ static void mh_scan_tree_recursive(FolderItem *item) real_path = item->path ? mh_filename_from_utf8(item->path) : g_strdup("."); dir = g_dir_open(real_path, 0, &error); if (!dir) { - g_warning("failed to open directory '%s': %s (%d)\n", + g_warning("failed to open directory '%s': %s (%d)", real_path, error->message, error->code); g_error_free(error); g_free(real_path); @@ -1212,7 +1212,7 @@ static gboolean mh_rename_folder_func(GNode *node, gpointer data) oldpathlen = strlen(oldpath); if (strncmp(oldpath, item->path, oldpathlen) != 0) { - g_warning("path doesn't match: %s, %s\n", oldpath, item->path); + g_warning("path doesn't match: %s, %s", oldpath, item->path); return TRUE; } @@ -1234,7 +1234,7 @@ static gchar *mh_filename_from_utf8(const gchar *path) gchar *real_path = g_filename_from_utf8(path, -1, NULL, NULL, NULL); if (!real_path) { - g_warning("mh_filename_from_utf8: failed to convert character set\n"); + g_warning("mh_filename_from_utf8: failed to convert character set"); real_path = g_strdup(path); } @@ -1245,7 +1245,7 @@ static gchar *mh_filename_to_utf8(const gchar *path) { gchar *utf8path = g_filename_to_utf8(path, -1, NULL, NULL, NULL); if (!utf8path) { - g_warning("mh_filename_to_utf8: failed to convert character set\n"); + g_warning("mh_filename_to_utf8: failed to convert character set"); utf8path = g_strdup(path); } diff --git a/src/mimeview.c b/src/mimeview.c @@ -1144,18 +1144,18 @@ static gboolean mimeview_check_sig_thread_cb(void *data) if (mimeinfo == NULL) { /* message changed !? */ - g_warning("no more siginfo!\n"); + g_warning("no more siginfo!"); goto end; } if (!mimeview->check_data) { - g_warning("nothing to check\n"); + g_warning("nothing to check"); return FALSE; } if (mimeview->check_data->siginfo != mimeinfo) { /* message changed !? */ - g_warning("different siginfo!\n"); + g_warning("different siginfo!"); goto end; } @@ -1198,7 +1198,7 @@ static void *mimeview_check_sig_worker_thread(void *data) } else { /* that's strange! we changed message without * getting killed. */ - g_warning("different siginfo!\n"); + g_warning("different siginfo!"); mimeview_check_data_reset(mimeview); return NULL; } diff --git a/src/msgcache.c b/src/msgcache.c @@ -313,7 +313,7 @@ gint msgcache_get_memory_usage(MsgCache *cache) \ if ((ni = fread(&idata, sizeof(idata), 1, fp)) != 1) { \ g_warning("read_int: Cache data corrupted, read %zd of %zd at " \ - "offset %ld\n", ni, sizeof(idata), ftell(fp)); \ + "offset %ld", ni, sizeof(idata), ftell(fp)); \ procmsg_msginfo_free(msginfo); \ error = TRUE; \ goto bail_err; \ @@ -421,7 +421,7 @@ static FILE *msgcache_open_data_file(const gchar *file, guint version, WRITE_CACHE_DATA_INT(version, fp); if (w_err != 0) { - g_warning("failed to write int\n"); + g_warning("failed to write int"); fclose(fp); return NULL; } @@ -474,7 +474,7 @@ static gint msgcache_read_cache_data_str(FILE *fp, gchar **str, if ((ni = fread(&len, sizeof(len), 1, fp) != 1) || len > G_MAXINT) { g_warning("read_data_str: Cache data (len) corrupted, read %zd " - "of %zd bytes at offset %ld\n", ni, sizeof(len), + "of %zd bytes at offset %ld", ni, sizeof(len), ftell(fp)); return -1; } @@ -482,7 +482,7 @@ static gint msgcache_read_cache_data_str(FILE *fp, gchar **str, if ((ni = fread(&len, sizeof(len), 1, fp) != 1) || bswap_32(len) > G_MAXINT) { g_warning("read_data_str: Cache data (len) corrupted, read %zd " - "of %zd bytes at offset %ld\n", ni, sizeof(len), + "of %zd bytes at offset %ld", ni, sizeof(len), ftell(fp)); return -1; } @@ -500,7 +500,7 @@ static gint msgcache_read_cache_data_str(FILE *fp, gchar **str, if ((ni = fread(tmpstr, 1, len, fp)) != len) { g_warning("read_data_str: Cache data corrupted, read %zd of %u " - "bytes at offset %ld\n", + "bytes at offset %ld", ni, len, ftell(fp)); g_free(tmpstr); return -1; @@ -527,7 +527,7 @@ static gint msgcache_get_cache_data_str(gchar *src, gchar **str, gint len, return 0; if(len > 2*1024*1024) { - g_warning("read_data_str: refusing to allocate %d bytes.\n", len); + g_warning("read_data_str: refusing to allocate %d bytes.", len); return -1; } @@ -1141,7 +1141,7 @@ gint msgcache_write(const gchar *cache_file, const gchar *mark_file, const gchar } if (w_err != 0) { - g_warning("failed to write charset\n"); + g_warning("failed to write charset"); if (write_fps.cache_fp) fclose(write_fps.cache_fp); claws_unlink(new_cache); diff --git a/src/news.c b/src/news.c @@ -584,7 +584,7 @@ static gchar *news_fetch_msg(Folder *folder, FolderItem *item, gint num) ok = news_get_article(folder, num, filename); if (ok != NEWSNNTP_NO_ERROR) { - g_warning("can't read article %d\n", num); + g_warning("can't read article %d", num); if (ok == NEWSNNTP_ERROR_STREAM) { session_destroy(SESSION(session)); REMOTE_FOLDER(folder)->session = NULL; @@ -941,7 +941,7 @@ gint news_cancel_article(Folder * folder, MsgInfo * msginfo) } if (change_file_mode_rw(tmpfp, tmp) < 0) { FILE_OP_ERROR(tmp, "chmod"); - g_warning("can't change file mode\n"); + g_warning("can't change file mode"); } get_rfc822_date(buf, sizeof(buf)); @@ -1375,7 +1375,7 @@ static gint news_remove_folder(Folder *folder, FolderItem *item) path = folder_item_get_path(item); if (remove_dir_recursive(path) < 0) { - g_warning("can't remove directory `%s'\n", path); + g_warning("can't remove directory '%s'", path); g_free(path); return -1; } diff --git a/src/partial_download.c b/src/partial_download.c @@ -148,7 +148,7 @@ static int partial_uidl_mark_mail(MsgInfo *msginfo, int download) filename = procmsg_get_message_file_path(msginfo); if (!filename) { - g_warning("can't get message file path.\n"); + g_warning("can't get message file path."); return err; } tinfo = procheader_parse_file(filename, msginfo->flags, TRUE, TRUE); diff --git a/src/plugins/archive/archiver_prefs.c b/src/plugins/archive/archiver_prefs.c @@ -414,7 +414,7 @@ static void save_archiver_prefs(PrefsPage * _page) return; if (prefs_write_param(param, pref_file->fp) < 0) { - g_warning("failed to write Archiver Plugin configuration\n"); + g_warning("failed to write Archiver Plugin configuration"); prefs_file_close_revert(pref_file); return; } diff --git a/src/plugins/att_remover/att_remover.c b/src/plugins/att_remover/att_remover.c @@ -538,7 +538,7 @@ gboolean plugin_done(void) return TRUE; if (prefs_write_param(prefs, pref_file->fp) < 0) { - g_warning("failed to write AttRemover Plugin configuration\n"); + g_warning("failed to write AttRemover Plugin configuration"); prefs_file_close_revert(pref_file); return TRUE; } diff --git a/src/plugins/bogofilter/bogofilter.c b/src/plugins/bogofilter/bogofilter.c @@ -210,7 +210,7 @@ static void bogofilter_do_filter(BogoFilterData *data) &bogo_stdout, NULL, &error); if (bogo_forked == FALSE) { - g_warning("%s\n", error ? error->message:"ERROR???"); + g_warning("%s", error ? error->message:"ERROR???"); g_error_free(error); error = NULL; status = -1; @@ -256,7 +256,7 @@ static void bogofilter_do_filter(BogoFilterData *data) memset(buf, 0, sizeof(buf)); /* get the result */ if (read(bogo_stdout, buf, sizeof(buf)-1) < 0) { - g_warning("bogofilter short read\n"); + g_warning("bogofilter short read"); debug_print("message %d is ham\n", msginfo->msgnum); data->mail_filtering_data->unfiltered = g_slist_prepend( data->mail_filtering_data->unfiltered, msginfo); @@ -908,7 +908,7 @@ void bogofilter_save_config(void) return; if (prefs_write_param(param, pfile->fp) < 0) { - g_warning("Failed to write Bogofilter configuration to file\n"); + g_warning("Failed to write Bogofilter configuration to file"); prefs_file_close_revert(pfile); return; } diff --git a/src/plugins/bsfilter/bsfilter.c b/src/plugins/bsfilter/bsfilter.c @@ -536,7 +536,7 @@ void bsfilter_save_config(void) return; if (prefs_write_param(param, pfile->fp) < 0) { - g_warning("Failed to write Bsfilter configuration to file\n"); + g_warning("Failed to write Bsfilter configuration to file"); prefs_file_close_revert(pfile); return; } diff --git a/src/plugins/clamd/clamav_plugin.c b/src/plugins/clamd/clamav_plugin.c @@ -118,7 +118,7 @@ static gboolean scan_func(GNode *node, gpointer data) case VIRUS: msg = g_strconcat(_("Detected %s virus."), clamd_get_virus_name(buf.msg), NULL); - g_warning("%s\n", msg); + g_warning("%s", msg); debug_print("no_recv: %d\n", prefs_common_get_prefs()->no_recv_err_panel); if (prefs_common_get_prefs()->no_recv_err_panel) { statusbar_print_all("%s", msg); @@ -246,7 +246,7 @@ void clamav_save_config(void) return; if (prefs_write_param(param, pfile->fp) < 0) { - g_warning("failed to write Clamd configuration to file\n"); + g_warning("failed to write Clamd configuration to file"); prefs_file_close_revert(pfile); return; } diff --git a/src/plugins/fancy/fancy_prefs.c b/src/plugins/fancy/fancy_prefs.c @@ -407,7 +407,7 @@ static void save_fancy_prefs(PrefsPage *page) return; if (prefs_write_param(param, pref_file->fp) < 0) { - g_warning("failed to write Fancy Plugin configuration\n"); + g_warning("failed to write Fancy Plugin configuration"); prefs_file_close_revert(pref_file); return; } diff --git a/src/plugins/gdata/cm_gdata_contacts.c b/src/plugins/gdata/cm_gdata_contacts.c @@ -665,7 +665,7 @@ void cm_gdata_load_contacts_cache_from_file(void) /* Check that root entry is "gdata" */ if(strcmp2(xmlnode->tag->tag, "gdata") != 0) { - g_warning("wrong gdata cache file\n"); + g_warning("wrong gdata cache file"); xml_free_tree(rootnode); return; } diff --git a/src/plugins/geolocation/geolocation_plugin.c b/src/plugins/geolocation/geolocation_plugin.c @@ -166,7 +166,7 @@ static gchar* get_ip_from_msginfo(MsgInfo *msginfo) return NULL; } if(!S_ISREG(ss.st_mode)) { - g_warning("mail file is not a regular file\n"); + g_warning("mail file is not a regular file"); return NULL; } diff --git a/src/plugins/libravatar/libravatar_cache.c b/src/plugins/libravatar/libravatar_cache.c @@ -71,7 +71,7 @@ static void cache_stat_item(gpointer filename, gpointer data) } } else { - g_warning("cannot stat %s\n", fname); + g_warning("cannot stat '%s'", fname); stats->errors++; } } @@ -85,7 +85,7 @@ static void cache_items_deep_first(const gchar *dir, GSList **items, guint *fail cm_return_if_fail(dir != NULL); if ((dp = g_dir_open(dir, 0, &error)) == NULL) { - g_warning("cannot open directory '%s': %s (%d)\n", + g_warning("cannot open directory '%s': %s (%d)", dir, error->message, error->code); g_error_free(error); (*failed)++; @@ -134,7 +134,7 @@ static void cache_delete_item(gpointer filename, gpointer errors) if (!is_dir_exist(fname)) { if (claws_unlink(fname) < 0) { - g_warning("couldn't delete file %s\n", fname); + g_warning("couldn't delete file '%s'", fname); (acr->e_unlink)++; } else { diff --git a/src/plugins/managesieve/managesieve.c b/src/plugins/managesieve/managesieve.c @@ -153,7 +153,7 @@ static gboolean sieve_read_chunk_cb(SockInfo *source, if (read_len == -1 && session->state == SESSION_DISCONNECTED) { - g_warning ("sock_read: session disconnected\n"); + g_warning ("sock_read: session disconnected"); if (session->io_tag > 0) { g_source_remove(session->io_tag); session->io_tag = 0; @@ -162,7 +162,7 @@ static gboolean sieve_read_chunk_cb(SockInfo *source, } if (read_len == 0) { - g_warning("sock_read: received EOF\n"); + g_warning("sock_read: received EOF"); session->state = SESSION_EOF; return FALSE; } @@ -172,7 +172,7 @@ static gboolean sieve_read_chunk_cb(SockInfo *source, case EAGAIN: return TRUE; default: - g_warning("sock_read: %s\n", + g_warning("sock_read: %s", g_strerror(errno)); session->state = SESSION_ERROR; return FALSE; diff --git a/src/plugins/managesieve/sieve_prefs.c b/src/plugins/managesieve/sieve_prefs.c @@ -444,7 +444,7 @@ void sieve_prefs_done(void) return; if (prefs_write_param(prefs, pref_file->fp) < 0) { - g_warning("failed to write ManageSieve Plugin configuration\n"); + g_warning("failed to write ManageSieve Plugin configuration"); prefs_file_close_revert(pref_file); return; } diff --git a/src/plugins/notification/gtkhotkey/x11/tomboykeybinder.c b/src/plugins/notification/gtkhotkey/x11/tomboykeybinder.c @@ -130,7 +130,7 @@ do_grab_key (Binding *binding) gdk_flush (); if (gdk_error_trap_pop ()) { - g_warning ("Binding '%s' failed!\n", binding->keystring); + g_warning ("Binding '%s' failed!", binding->keystring); return FALSE; } diff --git a/src/plugins/notification/notification_foldercheck.c b/src/plugins/notification/notification_foldercheck.c @@ -328,7 +328,7 @@ gboolean notification_foldercheck_read_array(void) /* Check that root entry is "foldercheckarray" */ if(strcmp2(xmlnode->tag->tag, "foldercheckarray") != 0) { - g_warning("wrong foldercheck array file\n"); + g_warning("wrong foldercheck array file"); xml_free_tree(rootnode); return FALSE; } @@ -342,7 +342,7 @@ gboolean notification_foldercheck_read_array(void) xmlnode = branchnode->data; if(strcmp2(xmlnode->tag->tag, "branch") != 0) { - g_warning("tag name != \"branch\"\n"); + g_warning("tag name != \"branch\""); return FALSE; } @@ -360,7 +360,7 @@ gboolean notification_foldercheck_read_array(void) } } if((list == NULL) || (entry == NULL)) { - g_warning("Did not find attribute \"name\" in tag \"branch\"\n"); + g_warning("Did not find attribute \"name\" in tag \"branch\""); continue; /* with next branch */ } @@ -371,12 +371,12 @@ gboolean notification_foldercheck_read_array(void) /* These should all be leaves. */ if(!G_NODE_IS_LEAF(node)) g_warning("Subnodes in \"branch\" nodes should all be leaves. " - "Ignoring deeper subnodes..\n"); + "Ignoring deeper subnodes."); /* Check if tag is "folderitem" */ xmlnode = node->data; if(strcmp2(xmlnode->tag->tag, "folderitem") != 0) { - g_warning("tag name != \"folderitem\"\n"); + g_warning("tag name != \"folderitem\""); continue; /* to next node in branch */ } @@ -393,7 +393,7 @@ gboolean notification_foldercheck_read_array(void) } if((list == NULL) || (item == NULL)) { g_warning("Did not find attribute \"identifier\" in tag " - "\"folderitem\"\n"); + "\"folderitem\""); continue; /* with next leaf node */ } diff --git a/src/plugins/pdf_viewer/poppler_viewer.c b/src/plugins/pdf_viewer/poppler_viewer.c @@ -556,7 +556,7 @@ static void pdf_viewer_get_document_index(PdfViewer *viewer, PopplerIndexIter *i PopplerDest *dest = poppler_document_find_dest( viewer->pdf_doc, action->goto_dest.dest->named_dest); if (dest->type != POPPLER_DEST_XYZ) { - g_warning("couldn't figure out link\n"); + g_warning("couldn't figure out link"); poppler_dest_free(dest); continue; } @@ -566,9 +566,9 @@ static void pdf_viewer_get_document_index(PdfViewer *viewer, PopplerIndexIter *i #endif else { #ifdef HAVE_POPPLER_DEST_NAMED - g_warning("unhandled link type %d\nplease contact developers\n", action->goto_dest.dest->type); + g_warning("unhandled link type %d. please contact developers", action->goto_dest.dest->type); #else - g_warning("unhandled link type %d\nplease upgrade libpoppler-glib to 0.5.4\n", action->goto_dest.dest->type); + g_warning("unhandled link type %d. please upgrade libpoppler-glib to 0.5.4", action->goto_dest.dest->type); #endif continue; } @@ -837,7 +837,7 @@ static void pdf_viewer_button_press_events_cb(GtkWidget *widget, GdkEventButton dest = poppler_document_find_dest( viewer->pdf_doc, viewer->link_action->goto_dest.dest->named_dest); if (dest->type != POPPLER_DEST_XYZ) { - g_warning("couldn't figure out link\n"); + g_warning("couldn't figure out link"); poppler_dest_free(dest); break; } @@ -852,7 +852,7 @@ static void pdf_viewer_button_press_events_cb(GtkWidget *widget, GdkEventButton dest = poppler_document_find_dest( viewer->pdf_doc, viewer->link_action->goto_remote.dest->named_dest); if (dest->type != POPPLER_DEST_XYZ) { - g_warning ("couldn't figure out link\n"); + g_warning ("couldn't figure out link"); poppler_dest_free(dest); break; } @@ -1298,7 +1298,7 @@ static void pdf_viewer_update(MimeViewer *_viewer, gboolean reload_file, int pag g_free(tmp); } else { - g_warning("gs conversion failed: %s returned %d\n", cmdline, result); + g_warning("gs conversion failed: %s returned %d", cmdline, result); tmp = g_strdup_printf("gs: err %d", result); alertpanel_warning("%s", tmp); g_free(tmp); @@ -1309,7 +1309,7 @@ static void pdf_viewer_update(MimeViewer *_viewer, gboolean reload_file, int pag g_free(tmpfile); } else { - g_warning("gs conversion disabled: gs binary was not found\n"); + g_warning("gs conversion disabled: gs binary was not found"); alertpanel_warning("PostScript view disabled: required gs program not found"); result = 1; @@ -1394,7 +1394,7 @@ static void pdf_viewer_update(MimeViewer *_viewer, gboolean reload_file, int pag viewer->pdf_page = poppler_document_get_page(viewer->pdf_doc, page_num - 1); if (viewer->pdf_page == NULL) { - g_warning("Page not found\n"); + g_warning("Page not found"); return; } diff --git a/src/plugins/pgpcore/passphrase.c b/src/plugins/pgpcore/passphrase.c @@ -154,11 +154,11 @@ try_again: gdkwin, NULL, GDK_CURRENT_TIME))) { if (err == GDK_GRAB_NOT_VIEWABLE && cnt < 10) { cnt++; - g_warning("trying to grab mouse again\n"); + g_warning("trying to grab mouse again"); gtk_main_iteration(); goto try_again; } else { - g_warning("OOPS: Could not grab mouse\n"); + g_warning("OOPS: Could not grab mouse"); gtk_widget_destroy(window); return NULL; } @@ -166,7 +166,7 @@ try_again: if (gdk_keyboard_grab(gdkwin, FALSE, GDK_CURRENT_TIME)) { gdk_display_pointer_ungrab(gdk_display_get_default(), GDK_CURRENT_TIME); - g_warning("OOPS: Could not grab keyboard\n"); + g_warning("OOPS: Could not grab keyboard"); gtk_widget_destroy(window); return NULL; } diff --git a/src/plugins/pgpcore/prefs_gpg.c b/src/plugins/pgpcore/prefs_gpg.c @@ -502,7 +502,7 @@ void prefs_gpg_save_config(void) return; if (prefs_write_param(param, pfile->fp) < 0) { - g_warning("failed to write GPG configuration to file\n"); + g_warning("failed to write GPG configuration to file"); prefs_file_close_revert(pfile); return; } @@ -562,7 +562,7 @@ void prefs_gpg_account_set_config(PrefsAccount *account, GPGAccountConfig *confi break; default: confstr = g_strdup(""); - g_warning("prefs_gpg_account_set_config: bad sign_key val\n"); + g_warning("prefs_gpg_account_set_config: bad sign_key val"); } prefs_account_set_privacy_prefs(account, "gpg", confstr); diff --git a/src/plugins/pgpcore/sgpgme.c b/src/plugins/pgpcore/sgpgme.c @@ -602,7 +602,7 @@ gboolean sgpgme_setup_signers(gpgme_ctx_t ctx, PrefsAccount *account, if (found_key != NULL) { gpgme_key_release(key); gpgme_op_keylist_end(ctx); - g_warning("ambiguous specification of secret key '%s'\n", keyid); + g_warning("ambiguous specification of secret key '%s'", keyid); privacy_set_error(_("Secret key specification is ambiguous")); goto bail; } @@ -624,7 +624,7 @@ gboolean sgpgme_setup_signers(gpgme_ctx_t ctx, PrefsAccount *account, gpgme_key_release(found_key); if (err) { - g_warning("error adding secret key: %s\n", + g_warning("error adding secret key: %s", gpgme_strerror(err)); privacy_set_error(_("Error setting secret key: %s"), gpgme_strerror(err)); @@ -996,7 +996,7 @@ void *sgpgme_data_release_and_get_mem(gpgme_data_t data, size_t *len) while ((r = gpgme_data_read(data, buf, BUFSIZ)) > 0) { void *rresult = realloc(result, r + w); if (rresult == NULL) { - g_warning("can't allocate memory\n"); + g_warning("can't allocate memory"); if (result != NULL) free(result); return NULL; diff --git a/src/plugins/pgpinline/pgpinline.c b/src/plugins/pgpinline/pgpinline.c @@ -181,7 +181,7 @@ static gint pgpinline_check_signature(MimeInfo *mimeinfo) conv_get_locale_charset_str_no_utf8()); } if (!tmp) { - g_warning("Can't convert charset to anything sane\n"); + g_warning("Can't convert charset to anything sane"); tmp = conv_codeset_strdup(textdata, CS_UTF_8, CS_US_ASCII); } g_free(textdata); diff --git a/src/plugins/rssyl/parse822.c b/src/plugins/rssyl/parse822.c @@ -64,14 +64,14 @@ FeedItem *rssyl_parse_folder_item_file(gchar *path) g_file_get_contents(path, &contents, NULL, &error); if( error ) { - g_warning("GError: '%s'\n", error->message); + g_warning("GError: '%s'", error->message); g_error_free(error); } if( contents != NULL ) { lines = strsplit_no_copy(contents, '\n'); } else { - g_warning("Badly formatted file found, ignoring: '%s'\n", path); + g_warning("Badly formatted file found, ignoring: '%s'", path); return NULL; } diff --git a/src/plugins/rssyl/rssyl.c b/src/plugins/rssyl/rssyl.c @@ -99,7 +99,7 @@ static void rssyl_make_rc_dir(void) if( !is_dir_exist(rssyl_dir) ) { if( make_dir(rssyl_dir) < 0 ) { - g_warning("couldn't create directory %s\n", rssyl_dir); + g_warning("couldn't create directory %s", rssyl_dir); } debug_print("RSSyl: created directory %s\n", rssyl_dir); @@ -550,7 +550,7 @@ static gboolean rssyl_rename_folder_func(GNode *node, gpointer data) oldpathlen = strlen(oldpath); if (strncmp(oldpath, item->path, oldpathlen) != 0) { - g_warning("path doesn't match: %s, %s\n", oldpath, item->path); + g_warning("path doesn't match: %s, %s", oldpath, item->path); return TRUE; } @@ -640,7 +640,7 @@ static gint rssyl_remove_folder(Folder *folder, FolderItem *item) path = folder_item_get_path(item); if( remove_dir_recursive(path) < 0 ) { - g_warning("can't remove directory '%s'\n", path); + g_warning("can't remove directory '%s'", path); g_free(path); return -1; } @@ -792,7 +792,7 @@ static gint rssyl_add_msgs(Folder *folder, FolderItem *dest, GSList *file_list, debug_print("RSSyl: add_msgs: new filename is '%s'\n", destfile); if( copy_file(fileinfo->file, destfile, TRUE) < 0 ) { - g_warning("can't copy message %s to %s\n", fileinfo->file, destfile); + g_warning("can't copy message %s to %s", fileinfo->file, destfile); g_free(destfile); return -1; } diff --git a/src/plugins/rssyl/rssyl_add_item.c b/src/plugins/rssyl/rssyl_add_item.c @@ -382,7 +382,7 @@ void rssyl_add_item(RFolderItem *ritem, FeedItem *feed_item) template = g_strconcat(dirname, G_DIR_SEPARATOR_S, RSSYL_TMP_TEMPLATE, NULL); if ((fd = g_mkstemp(template)) < 0) { - g_warning("Couldn't g_mkstemp('%s'), not adding message!\n", template); + g_warning("Couldn't g_mkstemp('%s'), not adding message!", template); g_free(dirname); g_free(template); return; @@ -390,7 +390,7 @@ void rssyl_add_item(RFolderItem *ritem, FeedItem *feed_item) f = fdopen(fd, "w"); if (f == NULL) { - g_warning("Couldn't open file '%s', not adding message!\n", template); + g_warning("Couldn't open file '%s', not adding message!", template); g_free(dirname); g_free(template); return; diff --git a/src/plugins/rssyl/rssyl_cb_menu.c b/src/plugins/rssyl/rssyl_cb_menu.c @@ -330,7 +330,7 @@ void rssyl_remove_mailbox_cb(GtkAction *action, gpointer data) n = folder_item_get_path(item); if( remove_dir_recursive(n) < 0 ) { - g_warning("can't remove directory '%s'\n", n); + g_warning("can't remove directory '%s'", n); g_free(n); return; } diff --git a/src/plugins/rssyl/rssyl_deleted.c b/src/plugins/rssyl/rssyl_deleted.c @@ -106,14 +106,14 @@ GSList *rssyl_deleted_update(RFolderItem *ritem) g_file_get_contents(deleted_file, &contents, NULL, &error); if (error) { - g_warning("GError: '%s'\n", error->message); + g_warning("GError: '%s'", error->message); g_error_free(error); } if (contents != NULL) { lines = strsplit_no_copy(contents, '\n'); } else { - g_warning("Couldn't read '%s', ignoring\n", deleted_file); + g_warning("Couldn't read '%s', ignoring", deleted_file); g_free(deleted_file); return NULL; } diff --git a/src/plugins/rssyl/rssyl_prefs.c b/src/plugins/rssyl/rssyl_prefs.c @@ -244,7 +244,7 @@ static void save_rssyl_prefs(PrefsPage *page) return; if( prefs_write_param(param, pref_file->fp) < 0 ) { - g_warning("Failed to write RSSyl plugin configuration\n"); + g_warning("Failed to write RSSyl plugin configuration"); prefs_file_close_revert(pref_file); return; } diff --git a/src/plugins/smime/smime.c b/src/plugins/smime/smime.c @@ -829,7 +829,7 @@ gboolean smime_encrypt(MimeInfo *mimeinfo, const gchar *encrypt_data) enccontent = sgpgme_data_release_and_get_mem(gpgenc, &len); if (!enccontent) { - g_warning("no enccontent\n"); + g_warning("no enccontent"); return FALSE; } diff --git a/src/plugins/spam_report/spam_report.c b/src/plugins/spam_report/spam_report.c @@ -267,7 +267,7 @@ static void report_spam(gint id, ReportInterface *intf, MsgInfo *msginfo, gchar } break; default: - g_warning("Unknown method\n"); + g_warning("Unknown method"); } g_free(reqbody); g_free(geturl); diff --git a/src/plugins/spam_report/spam_report_prefs.c b/src/plugins/spam_report/spam_report_prefs.c @@ -211,7 +211,7 @@ static void save_spamreport_prefs(PrefsPage *page) return; if (prefs_write_param(param, pref_file->fp) < 0) { - g_warning("failed to write SpamReport Plugin configuration\n"); + g_warning("failed to write SpamReport Plugin configuration"); prefs_file_close_revert(pref_file); return; } diff --git a/src/plugins/spamassassin/spamassassin.c b/src/plugins/spamassassin/spamassassin.c @@ -524,7 +524,7 @@ void spamassassin_save_config(void) return; if (prefs_write_param(param, pfile->fp) < 0) { - g_warning("Failed to write SpamAssassin configuration to file\n"); + g_warning("Failed to write SpamAssassin configuration to file"); prefs_file_close_revert(pfile); return; } diff --git a/src/plugins/vcalendar/day-view.c b/src/plugins/vcalendar/day-view.c @@ -674,20 +674,21 @@ static void build_day_view_colours(day_win *dw) gdk_colormap_alloc_color(pic1_cmap, &dw->bg2, FALSE, TRUE); if (!gdk_color_parse("white", &dw->line_color)) { + g_warning("color parse failed: white"); dw->line_color.red = 239 * (65535/255); dw->line_color.green = 235 * (65535/255); dw->line_color.blue = 230 * (65535/255); } if (!gdk_color_parse("blue", &dw->fg_sunday)) { - g_warning("color parse failed: red\n"); + g_warning("color parse failed: blue"); dw->fg_sunday.red = 10 * (65535/255); dw->fg_sunday.green = 10 * (65535/255); dw->fg_sunday.blue = 255 * (65535/255); } if (!gdk_color_parse("gold", &dw->bg_today)) { - g_warning("color parse failed: gold\n"); + g_warning("color parse failed: gold"); dw->bg_today.red = 255 * (65535/255); dw->bg_today.green = 215 * (65535/255); dw->bg_today.blue = 115 * (65535/255); diff --git a/src/plugins/vcalendar/month-view.c b/src/plugins/vcalendar/month-view.c @@ -753,20 +753,21 @@ static void build_month_view_colours(month_win *mw) gdk_colormap_alloc_color(pic1_cmap, &mw->bg2, FALSE, TRUE); if (!gdk_color_parse("white", &mw->line_color)) { + g_warning("color parse failed: white"); mw->line_color.red = 239 * (65535/255); mw->line_color.green = 235 * (65535/255); mw->line_color.blue = 230 * (65535/255); } if (!gdk_color_parse("blue", &mw->fg_sunday)) { - g_warning("color parse failed: red\n"); + g_warning("color parse failed: blue"); mw->fg_sunday.red = 10 * (65535/255); mw->fg_sunday.green = 10 * (65535/255); mw->fg_sunday.blue = 255 * (65535/255); } if (!gdk_color_parse("gold", &mw->bg_today)) { - g_warning("color parse failed: gold\n"); + g_warning("color parse failed: gold"); mw->bg_today.red = 255 * (65535/255); mw->bg_today.green = 215 * (65535/255); mw->bg_today.blue = 115 * (65535/255); diff --git a/src/plugins/vcalendar/vcal_folder.c b/src/plugins/vcalendar/vcal_folder.c @@ -1717,7 +1717,7 @@ gboolean vcal_curl_put(gchar *url, FILE *fp, gint filesize, const gchar *user, c curl_easy_getinfo(curl_ctx, CURLINFO_RESPONSE_CODE, &response_code); if (response_code < 200 || response_code >= 300) { - g_warning("Can't export calendar, got code %ld\n", response_code); + g_warning("Can't export calendar, got code %ld", response_code); res = FALSE; } curl_easy_cleanup(curl_ctx); @@ -1782,7 +1782,7 @@ static void update_subscription_finish(const gchar *uri, gchar *feed, gboolean v icalcomponent *cal = NULL; if (root == NULL) { - g_warning("can't get root folder\n"); + g_warning("can't get root folder"); g_free(feed); if (error) g_free(error); diff --git a/src/plugins/vcalendar/vcal_manager.c b/src/plugins/vcalendar/vcal_manager.c @@ -567,7 +567,7 @@ static gchar *write_headers_date(const gchar *uid) t = time(NULL) + (86400*7); t_subject = _("Later"); } else { - g_warning("unknown spec date\n"); + g_warning("unknown spec date"); return NULL; } @@ -972,7 +972,7 @@ void vcal_manager_save_event (VCalEvent *event, gboolean export_after) xml_free_tree(rootnode); if (prefs_file_close(pfile) < 0) { - g_warning("failed to write event.\n"); + g_warning("failed to write event."); return; } @@ -997,7 +997,7 @@ static VCalEvent *event_get_from_xml (const gchar *uid, GNode *node) xmlnode = node->data; if (strcmp2(xmlnode->tag->tag, "event") != 0) { - g_warning("tag name != \"event\"\n"); + g_warning("tag name != \"event\""); return NULL; } @@ -1065,7 +1065,7 @@ static VCalEvent *event_get_from_xml (const gchar *uid, GNode *node) xmlnode = node->data; if (strcmp2(xmlnode->tag->tag, "answer") != 0) { - g_warning("tag name != \"answer\"\n"); + g_warning("tag name != \"answer\""); return event; } list = xmlnode->tag->attr; @@ -1111,7 +1111,7 @@ VCalEvent *vcal_manager_load_event (const gchar *uid) g_free(path); if (!node) { - g_warning("no node\n"); + g_warning("no node"); return NULL; } @@ -1423,7 +1423,7 @@ static gboolean vcal_manager_send (PrefsAccount *account, folderitem = account_get_special_folder(account, F_QUEUE); if (!folderitem) { - g_warning("can't find queue folder for %s\n", account->address); + g_warning("can't find queue folder for %s", account->address); g_unlink(tmpfile); g_free(tmpfile); return FALSE; @@ -1431,7 +1431,7 @@ static gboolean vcal_manager_send (PrefsAccount *account, folder_item_scan(folderitem); if ((msgnum = folder_item_add_msg(folderitem, tmpfile, NULL, TRUE)) < 0) { - g_warning("can't queue the message\n"); + g_warning("can't queue the message"); g_unlink(tmpfile); g_free(tmpfile); return FALSE; diff --git a/src/plugins/vcalendar/vcal_meeting_gtk.c b/src/plugins/vcalendar/vcal_meeting_gtk.c @@ -1016,7 +1016,7 @@ static gboolean check_attendees_availability(VCalMeeting *meet, gboolean tell_if num_format++; } if (num_format > 2) { - g_warning("wrong format in %s!\n", real_url); + g_warning("wrong format in %s!", real_url); g_free(real_url); return FALSE; } @@ -2059,7 +2059,7 @@ gboolean vcal_meeting_export_calendar(const gchar *path, } if (str_write_to_file(icalcomponent_as_ical_string(calendar), internal_file) < 0) { - g_warning("can't export internal cal\n"); + g_warning("can't export internal cal"); } g_free(internal_file); @@ -2221,7 +2221,7 @@ gboolean vcal_meeting_export_freebusy(const gchar *path, const gchar *user, icalcomponent_add_component(calendar, vfreebusy); if (str_write_to_file(icalcomponent_as_ical_string(calendar), internal_file) < 0) { - g_warning("can't export freebusy\n"); + g_warning("can't export freebusy"); } g_free(internal_file); diff --git a/src/plugins/vcalendar/vcal_prefs.c b/src/plugins/vcalendar/vcal_prefs.c @@ -590,7 +590,7 @@ void vcal_prefs_save(void) return; if (prefs_write_param(param, pfile->fp) < 0) { - g_warning("failed to write Vcalendar configuration to file\n"); + g_warning("failed to write vCalendar configuration to file"); prefs_file_close_revert(pfile); return; } diff --git a/src/plugins/vcalendar/vcalendar.c b/src/plugins/vcalendar/vcalendar.c @@ -735,7 +735,7 @@ static void vcalviewer_get_reply_values(VCalViewer *vcalviewer, MimeInfo *mimein charset = CS_WINDOWS_1252; if (!vcalviewer->event->answers || g_slist_length(vcalviewer->event->answers) > 1) { - g_warning("strange, no answers or more than one\n"); + g_warning("strange, no answers or more than one"); } if (vcalviewer->event->answers) { @@ -1067,7 +1067,7 @@ static gboolean vcalviewer_action_cb(GtkButton *widget, gpointer data) s_vcalviewer = vcalviewer; if (!vcalviewer->event) { - g_warning("can't get event\n"); + g_warning("can't get event"); return TRUE; } @@ -1106,7 +1106,7 @@ static gboolean vcalviewer_action_cb(GtkButton *widget, gpointer data) if (event->organizer && *(event->organizer) && !vcal_manager_reply(account, event)) { - g_warning("couldn't send reply\n"); + g_warning("couldn't send reply"); } else { debug_print("no organizer, not sending answer\n"); } diff --git a/src/pop.c b/src/pop.c @@ -662,7 +662,7 @@ static void pop3_get_uidl_table(PrefsAccount *ac_prefs, Pop3Session *session) #define TRY(func) \ if (!(func)) \ { \ - g_warning("failed to write\n"); \ + g_warning("failed to write"); \ goto err_write; \ } \ @@ -765,7 +765,7 @@ static gint pop3_write_msg_to_file(const gchar *file, const gchar *data, if ((cur > prev && fwrite(prev, 1, cur - prev, fp) < 1) || fputc('\n', fp) == EOF) { FILE_OP_ERROR(file, "fwrite"); - g_warning("can't write to file: %s\n", file); + g_warning("can't write to file: %s", file); fclose(fp); claws_unlink(file); return -1; @@ -791,7 +791,7 @@ static gint pop3_write_msg_to_file(const gchar *file, const gchar *data, if (prev - data < len && fwrite(prev, 1, len - (prev - data), fp) < 1) { FILE_OP_ERROR(file, "fwrite"); - g_warning("can't write to file: %s\n", file); + g_warning("can't write to file: %s", file); fclose(fp); claws_unlink(file); return -1; @@ -799,7 +799,7 @@ static gint pop3_write_msg_to_file(const gchar *file, const gchar *data, if (data[len - 1] != '\r' && data[len - 1] != '\n') { if (fputc('\n', fp) == EOF) { FILE_OP_ERROR(file, "fputc"); - g_warning("can't write to file: %s\n", file); + g_warning("can't write to file: %s", file); fclose(fp); claws_unlink(file); return -1; diff --git a/src/prefs_account.c b/src/prefs_account.c @@ -3361,7 +3361,7 @@ static gboolean sslcert_get_client_cert_hook(gpointer source, gpointer data) hookdata->password = NULL; if (!g_list_find(account_get_list(), account)) { - g_warning("can't find sock account\n"); + g_warning("can't find account"); return TRUE; } @@ -3510,7 +3510,7 @@ void prefs_account_read_config(PrefsAccount *ac_prefs, const gchar *label) *ac_prefs = tmp_ac_prefs; while (*p && !g_ascii_isdigit(*p)) p++; id = atoi(p); - if (id < 0) g_warning("wrong account id: %d\n", id); + if (id < 0) g_warning("wrong account id: %d", id); ac_prefs->account_id = id; if (ac_prefs->protocol == A_APOP) { @@ -3562,7 +3562,7 @@ static void create_privacy_prefs(gpointer key, gpointer _value, gpointer user_da #define WRITE_PARAM(PARAM_TABLE) \ if (prefs_write_param(PARAM_TABLE, pfile->fp) < 0) { \ - g_warning("failed to write configuration to file\n"); \ + g_warning("failed to write configuration to file"); \ prefs_file_close_revert(pfile); \ g_free(privacy_prefs); \ privacy_prefs = NULL; \ @@ -3617,7 +3617,7 @@ void prefs_account_write_config_all(GList *account_list) } if (prefs_file_close(pfile) < 0) - g_warning("failed to write configuration to file\n"); + g_warning("failed to write configuration to file"); } #undef WRITE_PARAM diff --git a/src/prefs_actions.c b/src/prefs_actions.c @@ -464,7 +464,7 @@ void prefs_actions_read_config(void) tmp = conv_codeset_strdup(buf, src_codeset, dest_codeset); if (!tmp) { - g_warning("Failed to convert character set of action configuration\n"); + g_warning("Failed to convert character set of action configuration"); tmp = g_strdup(buf); } @@ -491,7 +491,7 @@ void prefs_actions_write_config(void) rcpath = g_strconcat(get_rc_dir(), G_DIR_SEPARATOR_S, ACTIONS_RC, NULL); if ((pfile= prefs_write_open(rcpath)) == NULL) { - g_warning("Failed to write configuration to file\n"); + g_warning("failed to write configuration to file"); g_free(rcpath); return; } @@ -504,7 +504,7 @@ void prefs_actions_write_config(void) act = conv_codeset_strdup(tmp, src_codeset, dest_codeset); if (!act) { - g_warning("Failed to convert character set of action configuration\n"); + g_warning("Failed to convert character set of action configuration"); act = g_strdup(act); } @@ -522,7 +522,7 @@ void prefs_actions_write_config(void) g_free(rcpath); if (prefs_file_close(pfile) < 0) { - g_warning("failed to write configuration to file\n"); + g_warning("failed to write configuration to file"); return; } } diff --git a/src/prefs_common.c b/src/prefs_common.c @@ -1289,7 +1289,7 @@ void prefs_common_read_config(void) #define TRY(func) \ if (!(func)) \ { \ - g_warning("failed to write\n"); \ + g_warning("failed to write"); \ goto out; \ } \ diff --git a/src/prefs_customheader.c b/src/prefs_customheader.c @@ -398,7 +398,7 @@ static void prefs_custom_header_write_config(PrefsAccount *ac) } if ((pfile = prefs_write_open(rcpath)) == NULL) { - g_warning("failed to write configuration to file\n"); + g_warning("failed to write configuration to file"); g_free(rcpath); return; } @@ -444,7 +444,7 @@ static void prefs_custom_header_write_config(PrefsAccount *ac) } if (prefs_file_close(pfile) < 0) { - g_warning("failed to write configuration to file\n"); + g_warning("failed to write configuration to file"); return; } } diff --git a/src/prefs_display_header.c b/src/prefs_display_header.c @@ -470,7 +470,7 @@ static void prefs_display_header_write_config(void) DISPLAY_HEADER_RC, NULL); if ((pfile = prefs_write_open(rcpath)) == NULL) { - g_warning("failed to write configuration to file\n"); + g_warning("failed to write configuration to file"); g_free(rcpath); return; } @@ -495,7 +495,7 @@ static void prefs_display_header_write_config(void) g_free(rcpath); if (prefs_file_close(pfile) < 0) { - g_warning("failed to write configuration to file\n"); + g_warning("failed to write configuration to file"); return; } } diff --git a/src/prefs_filtering_action.c b/src/prefs_filtering_action.c @@ -1701,7 +1701,7 @@ static gboolean prefs_filtering_actions_selected ACTION_CLEAR_TAGS); break; default: - g_warning("unhandled case !\n"); + g_warning("unhandled action type"); } if (action->destination) gtk_entry_set_text(GTK_ENTRY(filtering_action.dest_entry), action->destination); diff --git a/src/prefs_folder_column.c b/src/prefs_folder_column.c @@ -373,7 +373,7 @@ FolderColumnState *prefs_folder_column_get_config(void) pos = prefs_common.folder_col_pos[type]; if (pos < 0 || pos >= N_FOLDER_COLS || state[pos].type != -1) { - g_warning("Wrong column position\n"); + g_warning("Wrong column position"); prefs_folder_column_set_config(default_state); return default_state; } diff --git a/src/prefs_gtk.c b/src/prefs_gtk.c @@ -80,7 +80,7 @@ void prefs_read_config(PrefParam *param, const gchar *label, cm_return_if_fail(rcfile != NULL); if (encoding != NULL) - g_warning("Encoding is ignored\n"); + g_warning("Encoding is ignored"); debug_print("Reading configuration...\n"); @@ -242,7 +242,7 @@ static void prefs_config_parse_one_line(PrefParam *param, const gchar *buf) #define TRY(func) \ if (!(func)) \ { \ - g_warning("Failed to write configuration to file\n"); \ + g_warning("Failed to write configuration to file"); \ if (orig_fp) fclose(orig_fp); \ prefs_file_close_revert(pfile); \ g_free(rcpath); \ @@ -270,7 +270,7 @@ void prefs_write_config(PrefParam *param, const gchar *label, } if ((pfile = prefs_write_open(rcpath)) == NULL) { - g_warning("Failed to write configuration to file\n"); + g_warning("Failed to write configuration to file"); if (orig_fp) fclose(orig_fp); g_free(rcpath); return; @@ -326,7 +326,7 @@ void prefs_write_config(PrefParam *param, const gchar *label, if (orig_fp) fclose(orig_fp); if (prefs_file_close(pfile) < 0) - g_warning("Failed to write configuration to file\n"); + g_warning("Failed to write configuration to file"); g_free(rcpath); debug_print("Configuration is saved.\n"); @@ -674,7 +674,7 @@ void prefs_set_data_from_entry(PrefParam *pparam) *((gint *)pparam->data) = atoi(entry_str); break; default: - g_warning("Invalid PrefType for GtkEntry widget: %d\n", + g_warning("Invalid PrefType for GtkEntry widget: %d", pparam->type); } } @@ -692,7 +692,7 @@ void prefs_set_escaped_data_from_entry(PrefParam *pparam) *str = pref_get_pref_from_entry(GTK_ENTRY(*pparam->widget)); break; default: - g_warning("Invalid escaped PrefType for GtkEntry widget: %d\n", + g_warning("Invalid escaped PrefType for GtkEntry widget: %d", pparam->type); } } @@ -719,7 +719,7 @@ void prefs_set_entry(PrefParam *pparam) itos(*((gushort *)pparam->data))); break; default: - g_warning("Invalid PrefType for GtkEntry widget: %d\n", + g_warning("Invalid PrefType for GtkEntry widget: %d", pparam->type); } } @@ -737,7 +737,7 @@ void prefs_set_entry_from_escaped(PrefParam *pparam) *str ? *str : ""); break; default: - g_warning("Invalid escaped PrefType for GtkEntry widget: %d\n", + g_warning("Invalid escaped PrefType for GtkEntry widget: %d", pparam->type); } } @@ -790,7 +790,7 @@ void prefs_set_data_from_text(PrefParam *pparam) g_free(text); break; default: - g_warning("Invalid PrefType for GtkText widget: %d\n", + g_warning("Invalid PrefType for GtkText widget: %d", pparam->type); } } @@ -808,7 +808,7 @@ void prefs_set_escaped_data_from_text(PrefParam *pparam) *str = pref_get_pref_from_textview(GTK_TEXT_VIEW(*pparam->widget)); break; default: - g_warning("Invalid escaped PrefType for GtkText widget: %d\n", + g_warning("Invalid escaped PrefType for GtkText widget: %d", pparam->type); } } @@ -851,7 +851,7 @@ void prefs_set_text(PrefParam *pparam) gtk_text_buffer_insert(buffer, &iter, buf, -1); break; default: - g_warning("Invalid PrefType for GtkTextView widget: %d\n", + g_warning("Invalid PrefType for GtkTextView widget: %d", pparam->type); } } @@ -869,7 +869,7 @@ void prefs_set_text_from_escaped(PrefParam *pparam) *str ? *str : ""); break; default: - g_warning("Invalid escaped PrefType for GtkTextView widget: %d\n", + g_warning("Invalid escaped PrefType for GtkTextView widget: %d", pparam->type); } } @@ -908,7 +908,7 @@ void prefs_set_data_from_spinbtn(PrefParam *pparam) (GTK_SPIN_BUTTON(*pparam->widget)); break; default: - g_warning("Invalid PrefType for GtkSpinButton widget: %d\n", + g_warning("Invalid PrefType for GtkSpinButton widget: %d", pparam->type); } } @@ -927,7 +927,7 @@ void prefs_set_spinbtn(PrefParam *pparam) (gfloat)*((gushort *)pparam->data)); break; default: - g_warning("Invalid PrefType for GtkSpinButton widget: %d\n", + g_warning("Invalid PrefType for GtkSpinButton widget: %d", pparam->type); } } @@ -1104,7 +1104,7 @@ static gboolean prefs_read_config_from_cache(PrefParam *param, const gchar *labe sections_table = g_hash_table_lookup(whole_cache, rcfile); if (sections_table == NULL) { - g_warning("Can't find %s in the whole cache\n", rcfile?rcfile:"(null)"); + g_warning("Can't find %s in the whole cache", rcfile?rcfile:"(null)"); return FALSE; } values_table = g_hash_table_lookup(sections_table, label); diff --git a/src/prefs_msg_colors.c b/src/prefs_msg_colors.c @@ -628,7 +628,7 @@ static void quote_color_set_dialog(GtkWidget *widget, gpointer data) rgbvalue = prefs_common.color_new; } else { /* Should never be called */ - g_warning("Unrecognized datatype '%s' in quote_color_set_dialog\n", type); + g_warning("Unrecognized datatype '%s' in quote_color_set_dialog", type); return; } } diff --git a/src/prefs_summary_column.c b/src/prefs_summary_column.c @@ -388,7 +388,7 @@ SummaryColumnState *prefs_summary_column_get_config(void) pos = prefs_common.summary_col_pos[type]; if (pos < 0 || pos >= N_SUMMARY_COLS || state[pos].type != -1) { - g_warning("Wrong column position\n"); + g_warning("Wrong column position"); prefs_summary_column_set_config(default_state); return default_state; } diff --git a/src/prefs_themes.c b/src/prefs_themes.c @@ -183,7 +183,7 @@ static void prefs_themes_file_remove(const gchar *filename, gpointer data) base = g_path_get_basename(filename); if (TRUE == is_dir_exist(filename)) { if (strcmp(base, ".") != 0 && strcmp(base, "..") != 0) - g_warning("prefs_themes_file_remove(): subdir in theme dir skipped: '%s'.\n", + g_warning("prefs_themes_file_remove(): subdir in theme dir skipped: '%s'.", base); } else if (0 != claws_unlink(filename)) { @@ -203,7 +203,7 @@ static void prefs_themes_file_install(const gchar *filename, gpointer data) base = g_path_get_basename(filename); if (TRUE == is_dir_exist(filename)) { if (strcmp(base, ".") != 0 && strcmp(base, "..") !=0 ) - g_warning("prefs_themes_file_install(): subdir in theme dir skipped: '%s'.\n", + g_warning("prefs_themes_file_install(): subdir in theme dir skipped: '%s'.", base); } else { diff --git a/src/procheader.c b/src/procheader.c @@ -913,7 +913,7 @@ gboolean procheader_date_parse_to_tm(const gchar *src, struct tm *t, char *zone) if (procheader_scan_date_string(src, weekday, &day, month, &year, &hh, &mm, &ss, zone) < 0) { - g_warning("Invalid date: %s\n", src); + g_warning("Invalid date: %s", src); return FALSE; } @@ -929,7 +929,7 @@ gboolean procheader_date_parse_to_tm(const gchar *src, struct tm *t, char *zone) if ((p = strstr(monthstr, month)) != NULL) dmonth = (gint)(p - monthstr) / 3 + 1; else { - g_warning("Invalid month: %s\n", month); + g_warning("Invalid month: %s", month); dmonth = G_DATE_BAD_MONTH; } diff --git a/src/procmime.c b/src/procmime.c @@ -428,7 +428,7 @@ gboolean procmime_decode_content(MimeInfo *mimeinfo) } starting = FALSE; if (((inread != inlen) || len < 0) && !got_error) { - g_warning("Bad BASE64 content.\n"); + g_warning("Bad BASE64 content."); if (SC_FWRITE(_("[Error decoding BASE64]\n"), sizeof(gchar), strlen(_("[Error decoding BASE64]\n")), @@ -472,7 +472,7 @@ gboolean procmime_decode_content(MimeInfo *mimeinfo) len = fromuutobits(outbuf, buf); if (len <= 0) { if (len < 0) - g_warning("Bad UUENCODE content(%d)\n", len); + g_warning("Bad UUENCODE content (%d)", len); break; } if (SC_FWRITE(outbuf, sizeof(gchar), len, outfp) < len) @@ -551,7 +551,7 @@ gboolean procmime_encode_content(MimeInfo *mimeinfo, EncodingType encoding) if (mimeinfo->content == MIMECONTENT_FILE && mimeinfo->data.filename) { if ((infp = procmime_fopen(mimeinfo->data.filename, "rb")) == NULL) { - g_warning("Can't open file %s\n", mimeinfo->data.filename); + g_warning("Can't open file %s", mimeinfo->data.filename); procmime_fclose(outfp); return FALSE; } @@ -837,7 +837,7 @@ gboolean procmime_scan_text_content(MimeInfo *mimeinfo, } if (conv_fail) - g_warning("procmime_get_text_content(): Code conversion failed.\n"); + g_warning("procmime_get_text_content(): Code conversion failed."); procmime_fclose(tmpfp); claws_unlink(tmpfile); @@ -1255,7 +1255,7 @@ GList *procmime_get_mime_type_list(void) procmime_fclose(fp); if (!list) - g_warning("Can't read mime.types\n"); + g_warning("Can't read mime.types"); return list; } diff --git a/src/procmsg.c b/src/procmsg.c @@ -1000,7 +1000,7 @@ gint procmsg_send_queue(FolderItem *queue, gboolean save_msgs, gchar **errstr) if (procmsg_send_message_queue_full(file, !procmsg_is_last_for_account(queue, msginfo, elem), errstr, queue, msginfo->msgnum, &queued_removed) < 0) { - g_warning("Sending queued message %d failed.\n", + g_warning("Sending queued message %d failed.", msginfo->msgnum); err++; } else { @@ -1153,7 +1153,7 @@ gint procmsg_save_to_outbox(FolderItem *outbox, const gchar *file, folder_item_scan(outbox); if ((num = folder_item_add_msg(outbox, tmp, &flag, TRUE)) < 0) { - g_warning("can't save message\n"); + g_warning("can't save message"); claws_unlink(tmp); return -1; } @@ -1161,7 +1161,7 @@ gint procmsg_save_to_outbox(FolderItem *outbox, const gchar *file, folder_item_scan(outbox); if ((num = folder_item_add_msg (outbox, file, &flag, FALSE)) < 0) { - g_warning("can't save message\n"); + g_warning("can't save message"); return -1; } } @@ -1299,7 +1299,7 @@ MsgInfo *procmsg_msginfo_get_full_info_from_file(MsgInfo *msginfo, const gchar * if (msginfo == NULL) return NULL; if (!file || !is_file_exist(file)) { - g_warning("procmsg_msginfo_get_full_info_from_file(): can't get message file.\n"); + g_warning("procmsg_msginfo_get_full_info_from_file(): can't get message file."); return NULL; } @@ -1364,7 +1364,7 @@ MsgInfo *procmsg_msginfo_get_full_info(MsgInfo *msginfo) file = procmsg_get_message_file(msginfo); } if (!file || !is_file_exist(file)) { - g_warning("procmsg_msginfo_get_full_info(): can't get message file.\n"); + g_warning("procmsg_msginfo_get_full_info(): can't get message file."); return NULL; } @@ -1627,7 +1627,7 @@ send_mail: mailac = account_find_from_smtp_server(from, smtpserver); if (!mailac) { g_warning("Account not found. " - "Using current account...\n"); + "Using current account..."); mailac = cur_account; } } @@ -1641,7 +1641,7 @@ send_mail: } else { PrefsAccount tmp_ac; - g_warning("Account not found.\n"); + g_warning("Account not found."); memset(&tmp_ac, 0, sizeof(PrefsAccount)); tmp_ac.address = from; @@ -1684,7 +1684,7 @@ send_mail: } else { if (change_file_mode_rw(tmpfp, tmp) < 0) { FILE_OP_ERROR(tmp, "chmod"); - g_warning("can't change file mode\n"); + g_warning("can't change file mode"); } while ((newsval == 0) && fgets(buf, sizeof(buf), fp) != NULL) { diff --git a/src/quote_fmt_parse.y b/src/quote_fmt_parse.y @@ -96,7 +96,7 @@ static void remove_visibility(void) { stacksize--; if (stacksize < 0) { - g_warning("Error: visibility stack underflow\n"); + g_warning("Error: visibility stack underflow"); stacksize = 0; } } @@ -133,7 +133,7 @@ static void clear_buffer(void) gchar *quote_fmt_get_buffer(void) { if (current != &main_expr) - g_warning("Error: parser still in sub-expr mode\n"); + g_warning("Error: parser still in sub-expr mode"); if (error != 0) return NULL; @@ -233,7 +233,7 @@ void quote_fmt_init(MsgInfo *info, const gchar *my_quote_str, void quote_fmterror(char *str) { - g_warning("Error: %s at line %d\n", str, line); + g_warning("Error: %s at line %d", str, line); error = 1; } @@ -453,7 +453,7 @@ static void quote_fmt_show_msg(MsgInfo *msginfo, const gchar *body, } if (fp == NULL) - g_warning("Can't get text part\n"); + g_warning("Can't get text part"); else { while (fgets(buf, sizeof(buf), fp) != NULL) { strcrchomp(buf); diff --git a/src/send_message.c b/src/send_message.c @@ -512,7 +512,7 @@ static gint send_recv_message(Session *session, const gchar *msg, gpointer data) state_str = _("Quitting"); break; case SMTP_ERROR: - g_warning("send: error: %s\n", msg); + g_warning("send: error: %s", msg); return 0; default: return 0; diff --git a/src/setup.c b/src/setup.c @@ -44,7 +44,7 @@ gboolean setup_write_mailbox_path(MainWindow *mainwin, const gchar *path) if (!path) return FALSE; if (folder_find_from_path(path)) { - g_warning("The mailbox already exists.\n"); + g_warning("The mailbox already exists."); return FALSE; } diff --git a/src/summaryview.c b/src/summaryview.c @@ -3522,7 +3522,7 @@ gboolean defer_change(gpointer data) chg->unset_flags, chg->unset_tmp_flags); break; default: - g_warning("shouldn't happen\n"); + g_warning("unknown change op"); } g_free(chg); } @@ -5999,7 +5999,7 @@ static void summary_colorlabel_menu_item_activate_item_cb(GtkMenuItem *menu_item } } } else - g_warning("invalid number of color elements (%d)\n", n); + g_warning("invalid number of color elements (%d)", n); /* reset "dont_toggle" state */ g_object_set_data(G_OBJECT(menu), "dont_toggle", diff --git a/src/textview.c b/src/textview.c @@ -758,7 +758,7 @@ static void textview_add_part(TextView *textview, MimeInfo *mimeinfo) return; } if (error != NULL) { - g_warning("%s\n", error->message); + g_warning("%s", error->message); g_error_free(error); } if (!pixbuf) { @@ -1292,7 +1292,7 @@ static void textview_show_ertf(TextView *textview, FILE *fp, last->bp = (bp_); last->ep = (ep_); last->pti = (pti_); \ last->next = NULL; \ } else { \ - g_warning("alloc error scanning URIs\n"); \ + g_warning("alloc error scanning URIs"); \ gtk_text_buffer_insert_with_tags_by_name(buffer, &iter, \ linebuf, -1, \ fg_tag, NULL); \ @@ -1305,7 +1305,7 @@ static void textview_show_ertf(TextView *textview, FILE *fp, last->bp = (bp_); last->ep = (ep_); last->pti = (pti_); \ last->next = NULL; \ } else { \ - g_warning("alloc error scanning URIs\n"); \ + g_warning("alloc error scanning URIs"); \ } /* textview_make_clickable_parts() - colorizes clickable parts */ diff --git a/src/toolbar.c b/src/toolbar.c @@ -704,7 +704,7 @@ void toolbar_save_config_file(ToolbarType source) g_free( fileSpec ); if (prefs_file_close (pfile) < 0 ) - g_warning("failed to write toolbar configuration to file\n"); + g_warning("failed to write toolbar configuration to file"); return; fail: @@ -712,7 +712,7 @@ fail: g_free( fileSpec ); prefs_file_close_revert (pfile); } else - g_warning("failed to open toolbar configuration file for writing\n"); + g_warning("failed to open toolbar configuration file for writing"); } void toolbar_read_config_file(ToolbarType source) @@ -770,7 +770,7 @@ void toolbar_read_config_file(ToolbarType source) else if (source == TOOLBAR_MSGVIEW) toolbar_set_default(TOOLBAR_MSGVIEW); else { - g_warning("refusing to write unknown Toolbar Configuration number %d\n", source); + g_warning("refusing to write unknown Toolbar Configuration number %d", source); return; } @@ -1695,7 +1695,7 @@ static void toolbar_go_folders_cb(GtkWidget *widget, gpointer data) mainwin = (MainWindow*)toolbar_item->parent; break; default: - g_warning("wrong toolbar type\n"); + g_warning("wrong toolbar type"); return; }