diff options
author | Eduardo Chappa <chappa@washington.edu> | 2013-09-15 20:38:32 -0600 |
---|---|---|
committer | Eduardo Chappa <chappa@washington.edu> | 2013-09-15 20:38:32 -0600 |
commit | 48e1f5018f9d324c1ebce3ea627db50fe03a2134 (patch) | |
tree | 163db8aedac51e6aeb231fcb8ab5a0d124b265a2 /pith/string.c | |
parent | 1de2a1f9a4cc3b9496e836f9487c721526b4add1 (diff) | |
download | alpine-48e1f5018f9d324c1ebce3ea627db50fe03a2134.tar.xz |
* I had copied some code incorrectly in the fix for the issue about
transformation of dates in locales to utf-8, this made the fix
worse than then problem. Now it got fixed. This was reported by
Werner Scheinast.
Diffstat (limited to 'pith/string.c')
-rw-r--r-- | pith/string.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/pith/string.c b/pith/string.c index 7951ab39..9bd91d6a 100644 --- a/pith/string.c +++ b/pith/string.c @@ -752,11 +752,11 @@ void convert_string_to_utf8(char *buf, int bufsize) { char *s; - if(strucmp("UTF-8", ps_global->display_charmap)){ - s = convert_to_utf8(buf, ps_global->display_charmap, 0); - strncpy(buf, s ? s : "", bufsize); - buf[sizeof(buf)-1] = '\0'; - if(s) fs_give((void **)&s); + if(strucmp("UTF-8", ps_global->display_charmap) && + (s = convert_to_utf8(buf, ps_global->display_charmap, 0)) != NULL){ + strncpy(buf, s, bufsize); + buf[bufsize-1] = '\0'; + fs_give((void **)&s); } } |