commit 0720268ba69830d41dac9e12043a0f7eb3faa29a
parent 2e7b9fe39726ee786e45ac44d8ad4fbc6d0dcb30
Author: paul <paul@claws-mail.org>
Date: Thu, 24 Feb 2022 11:12:39 +0000
double the size of MAX_ALLOCA_MEM_SIZE and use standard sizing in alertpanel
Diffstat:
2 files changed, 5 insertions(+), 7 deletions(-)
diff --git a/src/common/utils.h b/src/common/utils.h
@@ -1,6 +1,6 @@
/*
* Claws Mail -- a GTK+ based, lightweight, and fast e-mail client
- * Copyright (C) 1999-2021 The Claws Mail Team and Hiroyuki Yamamoto
+ * Copyright (C) 1999-2022 The Claws Mail Team and Hiroyuki Yamamoto
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -95,11 +95,7 @@ typedef gint64 goffset;
} \
}
-/*
-100k of utf-8 text is 51200 utf-8 characters and
-51200 utf-8 characters is at least 28 A4 pages
-*/
-#define MAX_ALLOCA_MEM_SIZE 51200
+#define MAX_ALLOCA_MEM_SIZE 102400
#define Xalloca(ptr, size, iffail) \
{ \
diff --git a/src/compose.c b/src/compose.c
@@ -10889,7 +10889,9 @@ static void entry_paste_clipboard(Compose *compose, GtkWidget *entry,
glong len = g_utf8_strlen(contents, -1);
if (len > MAX_ALLOCA_MEM_SIZE) {
- alertpanel_error(_("Number of pages '%ld' exceeds limit '%d' for paste.\nAttach as file instead."), (len / 1800), (MAX_ALLOCA_MEM_SIZE / 1800));
+ alertpanel_error(_("Size of pasted text exceeds limit (%dKiB) for paste.\n"
+ "Attach as file instead."),
+ (MAX_ALLOCA_MEM_SIZE / 1024));
return;
}
/* we shouldn't delete the selection when middle-click-pasting, or we