aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorakir <akir>2004-08-25 10:03:09 (GMT)
committerakir <akir>2004-08-25 10:03:09 (GMT)
commitb57ce6ca8a80443c7b4927136e35e160fdaf345e (patch)
tree388e8e80d62ba153684f744c0132384077a19c49
parent94c823f9977e1cd457d31dbd6fb54f3397ef424d (diff)
downloadfluxbox_paul-b57ce6ca8a80443c7b4927136e35e160fdaf345e.zip
fluxbox_paul-b57ce6ca8a80443c7b4927136e35e160fdaf345e.tar.bz2
make use of "size" in "recode" -> fixes drawin the cursor in textboxes
-rw-r--r--ChangeLog2
-rw-r--r--src/FbTk/Font.cc9
2 files changed, 8 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index 3fae2ba..4b040a0 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,7 @@
1(Format: Year/Month/Day) 1(Format: Year/Month/Day)
2Changes for 0.9.10: 2Changes for 0.9.10:
3*04/08/25:
4 * Fix to draw Cursors in Textboxes correctly again (Mathias)
3*04/08/22: 5*04/08/22:
4 * Preliminary basic support for icons in fluxbox-generate_menu (Han) 6 * Preliminary basic support for icons in fluxbox-generate_menu (Han)
5 - put a <progname>.xpm into ~/.fluxbox/icons. e.g. Eterm.xpm 7 - put a <progname>.xpm into ~/.fluxbox/icons. e.g. Eterm.xpm
diff --git a/src/FbTk/Font.cc b/src/FbTk/Font.cc
index b79cdcc..7cacbd5 100644
--- a/src/FbTk/Font.cc
+++ b/src/FbTk/Font.cc
@@ -19,7 +19,7 @@
19// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 19// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20// DEALINGS IN THE SOFTWARE. 20// DEALINGS IN THE SOFTWARE.
21 21
22//$Id: Font.cc,v 1.11 2004/08/18 16:30:33 rathnor Exp $ 22//$Id: Font.cc,v 1.12 2004/08/25 10:03:09 akir Exp $
23 23
24 24
25#include "StringUtil.hh" 25#include "StringUtil.hh"
@@ -94,10 +94,13 @@ char* recode(iconv_t cd,
94 const char *msg, size_t size) { 94 const char *msg, size_t size) {
95 95
96 // If empty message, yes this can happen, return 96 // If empty message, yes this can happen, return
97 if(strlen(msg) == 0) 97 if(strlen(msg) == 0 || size == 0)
98 return 0; 98 return 0;
99 99
100 size_t inbytesleft = strlen(msg); 100 if(strlen(msg) < size)
101 size = strlen(msg);
102
103 size_t inbytesleft = size;
101 size_t outbytesleft = 4*inbytesleft; 104 size_t outbytesleft = 4*inbytesleft;
102 char *new_msg = new char[outbytesleft]; 105 char *new_msg = new char[outbytesleft];
103 char *new_msg_ptr = new_msg; 106 char *new_msg_ptr = new_msg;