diff options
author | Christian Grothoff <christian@grothoff.org> | 2012-09-25 13:20:16 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2012-09-25 13:20:16 +0000 |
commit | ac15ab4bc2928e9cfbbcd53dce67d3aa80034dda (patch) | |
tree | 1902efd3a03d48f5f72edcd2b8107ceda86723a4 | |
parent | f069afd000e26b5a1e2e10bd3e97658b1da5220c (diff) | |
download | libextractor-ac15ab4bc2928e9cfbbcd53dce67d3aa80034dda.tar.gz libextractor-ac15ab4bc2928e9cfbbcd53dce67d3aa80034dda.zip |
-fix conversion if iconv not found
-rw-r--r-- | src/common/convert.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/common/convert.c b/src/common/convert.c index 675fef4..b0726ee 100644 --- a/src/common/convert.c +++ b/src/common/convert.c | |||
@@ -86,7 +86,12 @@ EXTRACTOR_common_convert_to_utf8 (const char *input, | |||
86 | iconv_close (cd); | 86 | iconv_close (cd); |
87 | return ret; | 87 | return ret; |
88 | #else | 88 | #else |
89 | return strdup (input); | 89 | char *ret; |
90 | |||
91 | ret = malloc (len + 1); | ||
92 | memcpy (ret, input, len); | ||
93 | ret[len] = '\0'; | ||
94 | return ret; | ||
90 | #endif | 95 | #endif |
91 | } | 96 | } |
92 | 97 | ||