summaryrefslogtreecommitdiff
path: root/src/fl_utf.c
diff options
context:
space:
mode:
authorManolo Gouy <Manolo>2011-01-05 16:50:10 +0000
committerManolo Gouy <Manolo>2011-01-05 16:50:10 +0000
commit18ae07b181bf67191dc77563e01d64c63ee9ec2d (patch)
tree3b795442b66711b35bdb8ed1f933fc94c12f2b4c /src/fl_utf.c
parent3d470e8c0df71d5e671573250f7ab4cbb64e77d9 (diff)
Fix STR #2507. Applied supplied patch modified for Mac OS X. Checked OK on Linux.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@8192 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'src/fl_utf.c')
-rw-r--r--src/fl_utf.c11
1 files changed, 3 insertions, 8 deletions
diff --git a/src/fl_utf.c b/src/fl_utf.c
index d487ff668..9d6d48b81 100644
--- a/src/fl_utf.c
+++ b/src/fl_utf.c
@@ -692,8 +692,6 @@ int fl_utf8locale(void) {
needed.
If fl_utf8locale() returns true then this does not change the data.
- It is copied and truncated as necessary to
- the destination buffer and \p srclen is always returned.
*/
unsigned fl_utf8to_mb(const char* src, unsigned srclen,
char* dst, unsigned dstlen)
@@ -747,8 +745,7 @@ unsigned fl_utf8to_mb(const char* src, unsigned srclen,
memcpy(dst, src, srclen);
dst[srclen] = 0;
} else {
- memcpy(dst, src, dstlen-1);
- dst[dstlen-1] = 0;
+ // Buffer insufficent or buffer query
}
return srclen;
}
@@ -765,8 +762,7 @@ unsigned fl_utf8to_mb(const char* src, unsigned srclen,
needed.
On Unix or on Windows when a UTF-8 locale is in effect, this
- does not change the data. It is copied and truncated as necessary to
- the destination buffer and \p srclen is always returned.
+ does not change the data.
You may also want to check if fl_utf8test() returns non-zero, so that
the filesystem can store filenames in UTF-8 encoding regardless of
the locale.
@@ -813,8 +809,7 @@ unsigned fl_utf8from_mb(char* dst, unsigned dstlen,
memcpy(dst, src, srclen);
dst[srclen] = 0;
} else {
- memcpy(dst, src, dstlen-1);
- dst[dstlen-1] = 0;
+ // Buffer insufficent or buffer query
}
return srclen;
}