diff options
author | Pablo Saratxaga <pablo@mandriva.com> | 2003-01-07 17:56:10 +0000 |
---|---|---|
committer | Pablo Saratxaga <pablo@mandriva.com> | 2003-01-07 17:56:10 +0000 |
commit | 9492e7b62b939c457ae94956b3246bfbb5c43d63 (patch) | |
tree | 6a9af59d4fb99d3588a5ad0e7a34e06efde77225 /perl-install/c/stuff.xs.pl | |
parent | 433786fce3418924f5f082ad4ea46448ec0edbf3 (diff) | |
download | drakx-backup-do-not-use-9492e7b62b939c457ae94956b3246bfbb5c43d63.tar drakx-backup-do-not-use-9492e7b62b939c457ae94956b3246bfbb5c43d63.tar.gz drakx-backup-do-not-use-9492e7b62b939c457ae94956b3246bfbb5c43d63.tar.bz2 drakx-backup-do-not-use-9492e7b62b939c457ae94956b3246bfbb5c43d63.tar.xz drakx-backup-do-not-use-9492e7b62b939c457ae94956b3246bfbb5c43d63.zip |
*** empty log message ***
Diffstat (limited to 'perl-install/c/stuff.xs.pl')
-rw-r--r-- | perl-install/c/stuff.xs.pl | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/perl-install/c/stuff.xs.pl b/perl-install/c/stuff.xs.pl index f8bfed299..d5b711bd6 100644 --- a/perl-install/c/stuff.xs.pl +++ b/perl-install/c/stuff.xs.pl @@ -111,10 +111,13 @@ SV * iconv_(char* s, char* from_charset, char* to_charset) { char* retval = s; if (cd != (iconv_t) (-1)) { size_t s_len = strlen(retval); - char *buf = alloca(3 * s_len + 10); /* 10 for safety, it should not be needed */ + /* the maximum expansion when converting happens when converting + tscii to utf-8; each tscii char can become up to 4 unicode chars + and each one of those unicode chars can be 3 bytes long */ + char *buf = alloca(4 * 3 * s_len); { char *ptr = buf; - size_t ptr_len = 3 * s_len + 10; + size_t ptr_len = 4 * 3 * s_len; if ((iconv(cd, &s, &s_len, &ptr, &ptr_len)) != (size_t) (-1)) { *ptr = 0; retval = buf; |