[Commits] [SCM] claws branch, master, updated. 3.17.3-11-g6a1521a

ticho at claws-mail.org ticho at claws-mail.org
Sat Dec 29 14:27:49 CET 2018


The branch, master has been updated
       via  6a1521ae37726f05cb3ddeb1cee4a5d56eb00e06 (commit)
       via  26cbd8a164e6983f5e086e6b2aec63688080f66c (commit)
       via  35a3d37ca69e1f5beb79dde4d25b01e32d107ff2 (commit)
       via  324e61f543ec459d091bee943af1493d185a4df7 (commit)
       via  5eb5c4effbb503e7355a7e4030139d13f7a1cd79 (commit)
      from  2db0c5ebe5b6958c196838a483b490a881e9264b (commit)

Summary of changes:
 src/action.c                                |    7 ++++---
 src/common/ssl_certificate.c                |   13 ++++++++-----
 src/common/utils.c                          |   14 ++++++++++----
 src/etpan/imap-thread.c                     |   14 +++++++-------
 src/etpan/nntp-thread.c                     |    2 +-
 src/imap.c                                  |    4 ++--
 src/msgcache.c                              |   12 ++++++------
 src/password.c                              |    4 ++--
 src/plugins/fancy/fancy_viewer.c            |    2 +-
 src/plugins/libravatar/libravatar_image.c   |    2 +-
 src/plugins/libravatar/libravatar_missing.c |    6 +++---
 src/plugins/rssyl/parse822.c                |    2 +-
 src/plugins/tnef_parse/tnef_parse.c         |    2 +-
 src/plugins/vcalendar/vcal_folder.c         |    4 ++--
 src/plugins/vcalendar/vcal_manager.c        |    2 +-
 src/plugins/vcalendar/vcal_meeting_gtk.c    |    4 ++--
 src/procmime.c                              |   10 +++++-----
 17 files changed, 57 insertions(+), 47 deletions(-)


- Log -----------------------------------------------------------------
commit 6a1521ae37726f05cb3ddeb1cee4a5d56eb00e06
Author: Andrej Kacian <ticho at claws-mail.org>
Date:   Sat Dec 29 14:26:26 2018 +0100

    Do not needlessly cast time_t to long long int for debug_print()

diff --git a/src/plugins/libravatar/libravatar_missing.c b/src/plugins/libravatar/libravatar_missing.c
index 0ff67f0..8f3ebde 100644
--- a/src/plugins/libravatar/libravatar_missing.c
+++ b/src/plugins/libravatar/libravatar_missing.c
@@ -83,7 +83,7 @@ close_exit:
 static void missing_save_item(gpointer key, gpointer value, gpointer data)
 {
 	FILE *file = (FILE *)data;
-	gchar *line = g_strdup_printf("%s %llu\n", (gchar *)key, *((long long unsigned *)value));
+	gchar *line = g_strdup_printf("%s %lu\n", (gchar *)key, *(time_t *)value);
 	if (claws_fputs(line, file) < 0)
 		g_warning("error saving missing item");
 	g_free(line);
@@ -138,10 +138,10 @@ void missing_add_md5(GHashTable *table, const gchar *md5)
 		seen = g_malloc0(sizeof(time_t));
 		*seen = t;
 		g_hash_table_insert(table, g_strdup(md5), seen);
-		debug_print("New md5 %s added with time %llu\n", md5, (long long unsigned)t);
+		debug_print("New md5 %s added with time %lu\n", md5, t);
 	} else {
 		*seen = t; /* just update */
-		debug_print("Updated md5 %s with time %llu\n", md5, (long long unsigned)t);
+		debug_print("Updated md5 %s with time %lu\n", md5, t);
 	}
 }
 
diff --git a/src/plugins/rssyl/parse822.c b/src/plugins/rssyl/parse822.c
index 3f12414..9190889 100644
--- a/src/plugins/rssyl/parse822.c
+++ b/src/plugins/rssyl/parse822.c
@@ -137,7 +137,7 @@ FeedItem *rssyl_parse_folder_item_file(gchar *path)
 				/* Last-Seen timestamp */
 				if( !strcmp(line[0], "X-RSSyl-Last-Seen") ) {
 					ctx->last_seen = atol(line[1]);
-					debug_print("RSSyl: got last_seen timestamp %lld\n", (long long)ctx->last_seen);
+					debug_print("RSSyl: got last_seen timestamp %ld\n", ctx->last_seen);
 				}
 
 				/* ID */
diff --git a/src/plugins/vcalendar/vcal_folder.c b/src/plugins/vcalendar/vcal_folder.c
index 21a9227..db6acf3 100644
--- a/src/plugins/vcalendar/vcal_folder.c
+++ b/src/plugins/vcalendar/vcal_folder.c
@@ -1170,8 +1170,8 @@ static void vcal_set_mtime(Folder *folder, FolderItem *item)
 	}
 
 	item->mtime = s.st_mtime;
-	debug_print("VCAL: forced mtime of %s to %lld\n",
-			item->name?item->name:"(null)", (long long)item->mtime);
+	debug_print("VCAL: forced mtime of %s to %ld\n",
+			item->name?item->name:"(null)", item->mtime);
 	g_free(path);
 }
 
diff --git a/src/plugins/vcalendar/vcal_manager.c b/src/plugins/vcalendar/vcal_manager.c
index 073fd36..d2e8dae 100644
--- a/src/plugins/vcalendar/vcal_manager.c
+++ b/src/plugins/vcalendar/vcal_manager.c
@@ -926,7 +926,7 @@ void vcal_manager_save_event (VCalEvent *event, gboolean export_after)
 	xml_tag_add_attr(tag, xml_attr_new("type", tmp));
 	g_free(tmp);
 	
-	tmp = g_strdup_printf("%lld", (long long)event->postponed);
+	tmp = g_strdup_printf("%ld", event->postponed);
 	xml_tag_add_attr(tag, xml_attr_new("postponed", tmp));
 	g_free(tmp);
 	
diff --git a/src/plugins/vcalendar/vcal_meeting_gtk.c b/src/plugins/vcalendar/vcal_meeting_gtk.c
index c5ff05b..fd808f8 100644
--- a/src/plugins/vcalendar/vcal_meeting_gtk.c
+++ b/src/plugins/vcalendar/vcal_meeting_gtk.c
@@ -1824,8 +1824,8 @@ void multisync_export(void)
 	list = vcal_folder_get_waiting_events();
 	for (cur = list; cur; cur = cur->next) {
 		VCalEvent *event = (VCalEvent *)cur->data;
-		file = g_strdup_printf("multisync%lld-%d",
-				(long long)time(NULL), i);
+		file = g_strdup_printf("multisync%ld-%d",
+				time(NULL), i);
 
 		i++;
 

commit 26cbd8a164e6983f5e086e6b2aec63688080f66c
Author: Andrej Kacian <ticho at claws-mail.org>
Date:   Sat Dec 29 14:23:03 2018 +0100

    Fix printf formats for size_t and goffset arguments.
    
    Use G_GSIZE_FORMAT and G_GOFFSET_FORMAT macros
    instead of hardcoded literal formats, because these
    types can have different sizes on different platforms.

diff --git a/src/common/ssl_certificate.c b/src/common/ssl_certificate.c
index 7c8a244..ebe6168 100644
--- a/src/common/ssl_certificate.c
+++ b/src/common/ssl_certificate.c
@@ -176,11 +176,14 @@ 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)", gnutls_strerror(r), cert_size);
+		g_warning("couldn't export cert %s (%"G_GSIZE_FORMAT")", gnutls_strerror(r), cert_size);
 		return;
 	}
-
+#ifdef G_OS_WIN32
+	debug_print("writing %Iu bytes\n",cert_size);
+#else
 	debug_print("writing %zd bytes\n",cert_size);
+#endif
 	if (claws_fwrite(&output, 1, cert_size, fp) < cert_size) {
 		g_warning("failed to write cert: %d %s", errno, g_strerror(errno));
 	}
@@ -197,7 +200,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)", gnutls_strerror(r), cert_size);
+		g_warning("couldn't export cert %s (%"G_GSIZE_FORMAT")", gnutls_strerror(r), cert_size);
 		free(*output);
 		*output = NULL;
 		return 0;
@@ -216,7 +219,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)", gnutls_strerror(r), key_size);
+		g_warning("couldn't export key %s (%"G_GSIZE_FORMAT")", gnutls_strerror(r), key_size);
 		free(*output);
 		*output = NULL;
 		return 0;
@@ -510,7 +513,7 @@ static gboolean ssl_certificate_compare (SSLCertificate *cert_a, SSLCertificate
 		return FALSE;
 	}
 	if (cert_size_a != cert_size_b) {
-		g_warning("size differ %zd %zd", cert_size_a, cert_size_b);
+		g_warning("size differ %"G_GSIZE_FORMAT" %"G_GSIZE_FORMAT, cert_size_a, cert_size_b);
 		g_free(output_a);
 		g_free(output_b);
 		return FALSE;
diff --git a/src/common/utils.c b/src/common/utils.c
index c4364c4..ec87994 100644
--- a/src/common/utils.c
+++ b/src/common/utils.c
@@ -4547,7 +4547,7 @@ guchar *g_base64_decode_zero(const gchar *text, gsize *out_len)
 	g_free(tmp);
 
 	if (strlen(out) != *out_len) {
-		g_warning ("strlen(out) %zd != *out_len %" G_GSIZE_FORMAT, strlen(out), *out_len);
+		g_warning ("strlen(out) %"G_GSIZE_FORMAT" != *out_len %"G_GSIZE_FORMAT, strlen(out), *out_len);
 	}
 
 	return out;
@@ -4617,7 +4617,7 @@ get_random_bytes(void *buf, size_t count)
 	/* Read data from the source into buf. */
 #if defined G_OS_WIN32
 	if (!CryptGenRandom(rnd, count, buf)) {
-		debug_print("Could not read %zd random bytes.\n", count);
+		debug_print("Could not read %"G_GSIZE_FORMAT" random bytes.\n", count);
 		CryptReleaseContext(rnd, 0);
 		return FALSE;
 	}
diff --git a/src/etpan/imap-thread.c b/src/etpan/imap-thread.c
index c6dd801..be5678c 100644
--- a/src/etpan/imap-thread.c
+++ b/src/etpan/imap-thread.c
@@ -161,7 +161,7 @@ static void imap_logger_cmd(int direction, const char * str, size_t size)
 	int i = 0;
 
 	if (size > 8192) {
-		log_print(LOG_PROTOCOL, "IMAP%c [CMD data - %zd bytes]\n", direction?'>':'<', size);
+		log_print(LOG_PROTOCOL, "IMAP%c [CMD data - %"G_GSIZE_FORMAT" bytes]\n", direction?'>':'<', size);
 		return;
 	}
 	buf = malloc(size+1);
@@ -196,7 +196,7 @@ static void imap_logger_fetch(int direction, const char * str, size_t size)
 	int i = 0;
 
 	if (size > 128 && !direction) {
-		log_print(LOG_PROTOCOL, "IMAP%c [FETCH data - %zd bytes]\n", direction?'>':'<', size);
+		log_print(LOG_PROTOCOL, "IMAP%c [FETCH data - %"G_GSIZE_FORMAT" bytes]\n", direction?'>':'<', size);
 		return;
 	}
 	
@@ -222,7 +222,7 @@ static void imap_logger_fetch(int direction, const char * str, size_t size)
 			i++;
 		}
 	} else {
-		log_print(LOG_PROTOCOL, "IMAP%c [data - %zd bytes]\n", direction?'>':'<', size);
+		log_print(LOG_PROTOCOL, "IMAP%c [data - %"G_GSIZE_FORMAT" bytes]\n", direction?'>':'<', size);
 	}
 	g_strfreev(lines);
 	free(buf);
@@ -235,7 +235,7 @@ static void imap_logger_uid(int direction, const char * str, size_t size)
 	int i = 0;
 
 	if (size > 8192) {
-		log_print(LOG_PROTOCOL, "IMAP%c [UID data - %zd bytes]\n", direction?'>':'<', size);
+		log_print(LOG_PROTOCOL, "IMAP%c [UID data - %"G_GSIZE_FORMAT" bytes]\n", direction?'>':'<', size);
 		return;
 	}
 	buf = malloc(size+1);
@@ -277,10 +277,10 @@ static void imap_logger_append(int direction, const char * str, size_t size)
 	int i = 0;
 
 	if (size > 8192) {
-		log_print(LOG_PROTOCOL, "IMAP%c [APPEND data - %zd bytes]\n", direction?'>':'<', size);
+		log_print(LOG_PROTOCOL, "IMAP%c [APPEND data - %"G_GSIZE_FORMAT" bytes]\n", direction?'>':'<', size);
 		return;
 	} else if (direction == 0 && size > 64) {
-		log_print(LOG_PROTOCOL, "IMAP%c [APPEND data - %zd bytes]\n", direction?'>':'<', size);
+		log_print(LOG_PROTOCOL, "IMAP%c [APPEND data - %"G_GSIZE_FORMAT" bytes]\n", direction?'>':'<', size);
 		return;
 	} 
 	buf = malloc(size+1);
@@ -305,7 +305,7 @@ static void imap_logger_append(int direction, const char * str, size_t size)
 			i++;
 		}
 	} else {
-		log_print(LOG_PROTOCOL, "IMAP%c [data - %zd bytes]\n", direction?'>':'<', size);
+		log_print(LOG_PROTOCOL, "IMAP%c [data - %"G_GSIZE_FORMAT" bytes]\n", direction?'>':'<', size);
 	}
 	g_strfreev(lines);
 	free(buf);
diff --git a/src/etpan/nntp-thread.c b/src/etpan/nntp-thread.c
index ccaede9..bf67cd0 100644
--- a/src/etpan/nntp-thread.c
+++ b/src/etpan/nntp-thread.c
@@ -136,7 +136,7 @@ static void nntp_logger(int direction, const char * str, size_t size)
 	int i = 0;
 
 	if (size > 256) {
-		log_print(LOG_PROTOCOL, "NNTP%c [data - %zd bytes]\n", direction?'>':'<', size);
+		log_print(LOG_PROTOCOL, "NNTP%c [data - %"G_GSIZE_FORMAT" bytes]\n", direction?'>':'<', size);
 		return;
 	}
 	buf = malloc(size+1);
diff --git a/src/imap.c b/src/imap.c
index 264dd7d..db6770a 100644
--- a/src/imap.c
+++ b/src/imap.c
@@ -1587,7 +1587,7 @@ static gchar *imap_fetch_msg_full(Folder *folder, FolderItem *item, gint uid,
 				ok = file_strip_crs(filename);
 				if (ok == 0 && cached && cached->size <= have_size) {
 					/* we have it all and stripped */
-					debug_print("...fully cached in fact (%u/%zd); setting flag.\n",
+					debug_print("...fully cached in fact (%u/%"G_GOFFSET_FORMAT"); setting flag.\n",
 							have_size, cached->size);
 					procmsg_msginfo_set_flags(cached, MSG_FULLY_CACHED, 0);
 				}
@@ -1691,7 +1691,7 @@ static gboolean imap_is_msg_fully_cached(Folder *folder, FolderItem *item, gint
 		size = get_file_size_with_crs(filename);
 	}
 	g_free(filename);
-	debug_print("msg %d cached, has size %d, full should be %zd.\n", uid, size, cached->size);
+	debug_print("msg %d cached, has size %d, full should be %"G_GOFFSET_FORMAT".\n", uid, size, cached->size);
 	if (cached && size >= cached->size) {
 		cached->total_size = cached->size;
 		procmsg_msginfo_set_flags(cached, MSG_FULLY_CACHED, 0);
diff --git a/src/msgcache.c b/src/msgcache.c
index 3910255..fd07397 100644
--- a/src/msgcache.c
+++ b/src/msgcache.c
@@ -306,7 +306,7 @@ gint msgcache_get_memory_usage(MsgCache *cache)
 	size_t ni; \
  \
 	if ((ni = claws_fread(&idata, sizeof(idata), 1, fp)) != 1) { \
-		g_warning("read_int: Cache data corrupted, read %zd of %zd at " \
+		g_warning("read_int: Cache data corrupted, read %"G_GSIZE_FORMAT" of %"G_GSIZE_FORMAT" at " \
 			  "offset %ld", ni, sizeof(idata), ftell(fp)); \
 		procmsg_msginfo_free(&msginfo); \
 		error = TRUE; \
@@ -467,16 +467,16 @@ static gint msgcache_read_cache_data_str(FILE *fp, gchar **str,
 	if (!swapping) {
 		if ((ni = claws_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", ni, sizeof(len),
+			g_warning("read_data_str: Cache data (len) corrupted, read %"G_GSIZE_FORMAT
+				  " of %"G_GSIZE_FORMAT" bytes at offset %ld", ni, sizeof(len),
 				  ftell(fp));
 			return -1;
 		}
 	} else {
 		if ((ni = claws_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", ni, sizeof(len),
+			g_warning("read_data_str: Cache data (len) corrupted, read %"G_GSIZE_FORMAT
+				  " of %"G_GSIZE_FORMAT" bytes at offset %ld", ni, sizeof(len),
 				  ftell(fp));
 			return -1;
 		}
@@ -493,7 +493,7 @@ static gint msgcache_read_cache_data_str(FILE *fp, gchar **str,
 	}
 
 	if ((ni = claws_fread(tmpstr, 1, len, fp)) != len) {
-		g_warning("read_data_str: Cache data corrupted, read %zd of %u "
+		g_warning("read_data_str: Cache data corrupted, read %"G_GSIZE_FORMAT" of %u "
 			  "bytes at offset %ld",
 			  ni, len, ftell(fp));
 		g_free(tmpstr);
diff --git a/src/password.c b/src/password.c
index 463715b..8105820 100644
--- a/src/password.c
+++ b/src/password.c
@@ -188,7 +188,7 @@ gboolean master_passphrase_is_correct(const gchar *input)
 	g_strfreev(tokens);
 
 	if (kd_len != KD_LENGTH) {
-		debug_print("master_passphrase is %ld bytes long, should be %d.\n",
+		debug_print("master_passphrase is %"G_GSIZE_FORMAT" bytes long, should be %d.\n",
 				kd_len, KD_LENGTH);
 		g_free(kd);
 		return FALSE;
@@ -488,7 +488,7 @@ gchar *password_decrypt_gnutls(const gchar *password,
 			g_free(tmp);
 		return NULL;
 	}
-	debug_print("Encrypted password string length: %lu\n", len);
+	debug_print("Encrypted password string length: %"G_GSIZE_FORMAT"\n", len);
 
 	/* Initialize the decryption */
 	ret = gnutls_cipher_init(&handle, algo, &key, &iv);
diff --git a/src/plugins/fancy/fancy_viewer.c b/src/plugins/fancy/fancy_viewer.c
index 3792e84..a6eddb2 100644
--- a/src/plugins/fancy/fancy_viewer.c
+++ b/src/plugins/fancy/fancy_viewer.c
@@ -457,7 +457,7 @@ static void resource_request_starting_cb(WebKitWebView		*view,
 		webkit_network_request_set_uri(request, "about:blank");
 	}
 	else
-		debug_print("Starting request of %zu %s\n", strlen(uri), uri);
+		debug_print("Starting request of %"G_GSIZE_FORMAT" %s\n", strlen(uri), uri);
 }
 
 static gboolean fancy_text_search(MimeViewer *_viewer, gboolean backward,
diff --git a/src/plugins/libravatar/libravatar_image.c b/src/plugins/libravatar/libravatar_image.c
index d36408e..9a0338b 100644
--- a/src/plugins/libravatar/libravatar_image.c
+++ b/src/plugins/libravatar/libravatar_image.c
@@ -37,7 +37,7 @@
 static size_t write_image_data_cb(void *ptr, size_t size, size_t nmemb, void *stream)
 {
 	size_t written = claws_fwrite(ptr, size, nmemb, (FILE *)stream);
-	debug_print("received %zu bytes from avatar server\n", written);
+	debug_print("received %"G_GSIZE_FORMAT" bytes from avatar server\n", written);
 
 	return written;
 }
diff --git a/src/plugins/tnef_parse/tnef_parse.c b/src/plugins/tnef_parse/tnef_parse.c
index be8812d..82a8f9e 100644
--- a/src/plugins/tnef_parse/tnef_parse.c
+++ b/src/plugins/tnef_parse/tnef_parse.c
@@ -297,7 +297,7 @@ static gboolean tnef_parse (MimeParser *parser, MimeInfo *mimeinfo)
 	if (mimeinfo->content == MIMECONTENT_FILE)
 		debug_print("content: %s\n", mimeinfo->data.filename);
 	else 
-		debug_print("contents in memory (len %zd)\n", 
+		debug_print("contents in memory (len %"G_GSIZE_FORMAT")\n", 
 			strlen(mimeinfo->data.mem));
 	
 	tnef = g_new0(TNEFStruct, 1);
diff --git a/src/procmime.c b/src/procmime.c
index 484d6a4..e259adb 100644
--- a/src/procmime.c
+++ b/src/procmime.c
@@ -1270,7 +1270,7 @@ EncodingType procmime_get_encoding_for_text_file(const gchar *file, gboolean *ha
 		octet_percentage = 0.0;
 
 	debug_print("procmime_get_encoding_for_text_file(): "
-		    "8bit chars: %zd / %zd (%f%%)\n", octet_chars, total_len,
+		    "8bit chars: %"G_GSIZE_FORMAT" / %"G_GSIZE_FORMAT" (%f%%)\n", octet_chars, total_len,
 		    100.0 * octet_percentage);
 
 	if (octet_percentage > 0.20 || force_b64) {
@@ -2472,7 +2472,7 @@ static gint procmime_write_message_rfc822(MimeInfo *mimeinfo, FILE *fp)
 			}
 			len = strlen(buf);
 			if (claws_fwrite(buf, sizeof(gchar), len, fp) < len) {
-				g_warning("failed to dump %zd bytes from file", len);
+				g_warning("failed to dump %"G_GSIZE_FORMAT" bytes from file", len);
 				claws_fclose(infp);
 				return -1;
 			}
@@ -2484,7 +2484,7 @@ static gint procmime_write_message_rfc822(MimeInfo *mimeinfo, FILE *fp)
 	case MIMECONTENT_MEM:
 		len = strlen(mimeinfo->data.mem);
 		if (claws_fwrite(mimeinfo->data.mem, sizeof(gchar), len, fp) < len) {
-			g_warning("failed to dump %zd bytes from mem", len);
+			g_warning("failed to dump %"G_GSIZE_FORMAT" bytes from mem", len);
 			return -1;
 		}
 		break;
@@ -2536,7 +2536,7 @@ static gint procmime_write_multipart(MimeInfo *mimeinfo, FILE *fp)
 				break;
 			len = strlen(buf);
 			if (claws_fwrite(buf, sizeof(gchar), len, fp) < len) {
-				g_warning("failed to write %zd", len);
+				g_warning("failed to write %"G_GSIZE_FORMAT, len);
 				claws_fclose(infp);
 				return -1;
 			}
@@ -2551,7 +2551,7 @@ static gint procmime_write_multipart(MimeInfo *mimeinfo, FILE *fp)
 			*(str2 - 2) = '\0';
 		len = strlen(str);
 		if (claws_fwrite(str, sizeof(gchar), len, fp) < len) {
-			g_warning("failed to write %zd from mem", len);
+			g_warning("failed to write %"G_GSIZE_FORMAT" from mem", len);
 			g_free(str);
 			return -1;
 		}

commit 35a3d37ca69e1f5beb79dde4d25b01e32d107ff2
Author: Andrej Kacian <ticho at claws-mail.org>
Date:   Sat Dec 29 14:21:19 2018 +0100

    Fix pid handling in debug output of kill_children_cb()
    
    On Windows, "pid" points to a HANDLE object, not to
    an integer.

diff --git a/src/action.c b/src/action.c
index f40e163..37ce5ff 100644
--- a/src/action.c
+++ b/src/action.c
@@ -1056,13 +1056,14 @@ static void kill_children_cb(GtkWidget *widget, gpointer data)
 
 	for (cur = children->list; cur; cur = cur->next) {
 		child_info = (ChildInfo *)(cur->data);
+#ifdef G_OS_WIN32
+		debug_print("Killing child group HANDLE %p\n", child_info->pid);
+		TerminateProcess(child_info->pid, 0);
+#else
 		debug_print("Killing child group id %d\n", child_info->pid);
-#ifdef G_OS_UNIX
 		if (child_info->pid && kill(child_info->pid, child_info->next_sig) < 0)
 			perror("kill");
 		child_info->next_sig = SIGKILL;
-#else
-		TerminateProcess(child_info->pid, 0);
 #endif
 	}
 }

commit 324e61f543ec459d091bee943af1493d185a4df7
Author: Andrej Kacian <ticho at claws-mail.org>
Date:   Sat Dec 29 14:09:42 2018 +0100

    Emulate strftime's %r on Windows which does not have that

diff --git a/src/common/utils.c b/src/common/utils.c
index feda18d..c4364c4 100644
--- a/src/common/utils.c
+++ b/src/common/utils.c
@@ -4234,7 +4234,11 @@ size_t fast_strftime(gchar *buf, gint buflen, const gchar *format, struct tm *lt
 				}
 				break;
 			case 'r':
+#ifdef G_OS_WIN32
+				strftime(subbuf, 64, "%I:%M:%S %p", lt);
+#else
 				strftime(subbuf, 64, "%r", lt);
+#endif
 				len = strlen(subbuf); CHECK_SIZE();
 				strncpy2(curpos, subbuf, buflen - total_done);
 				break;

commit 5eb5c4effbb503e7355a7e4030139d13f7a1cd79
Author: Andrej Kacian <ticho at claws-mail.org>
Date:   Sat Dec 29 14:08:46 2018 +0100

    Fix missing ws2tcpip.h include for Windows

diff --git a/src/common/utils.c b/src/common/utils.c
index 195193b..feda18d 100644
--- a/src/common/utils.c
+++ b/src/common/utils.c
@@ -49,8 +49,10 @@
 #include <ctype.h>
 #include <errno.h>
 #include <sys/param.h>
-#ifndef G_OS_WIN32
-#include <sys/socket.h>
+#ifdef G_OS_WIN32
+#  include <ws2tcpip.h>
+#else
+#  include <sys/socket.h>
 #endif
 
 #if (HAVE_WCTYPE_H && HAVE_WCHAR_H)

-----------------------------------------------------------------------


hooks/post-receive
-- 
Claws Mail


More information about the Commits mailing list