diff options
author | akir <akir> | 2004-08-25 10:03:09 (GMT) |
---|---|---|
committer | akir <akir> | 2004-08-25 10:03:09 (GMT) |
commit | b57ce6ca8a80443c7b4927136e35e160fdaf345e (patch) | |
tree | 388e8e80d62ba153684f744c0132384077a19c49 /src/FbTk | |
parent | 94c823f9977e1cd457d31dbd6fb54f3397ef424d (diff) | |
download | fluxbox_pavel-b57ce6ca8a80443c7b4927136e35e160fdaf345e.zip fluxbox_pavel-b57ce6ca8a80443c7b4927136e35e160fdaf345e.tar.bz2 |
make use of "size" in "recode" -> fixes drawin the cursor in textboxes
Diffstat (limited to 'src/FbTk')
-rw-r--r-- | src/FbTk/Font.cc | 9 |
1 files changed, 6 insertions, 3 deletions
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; |