summaryrefslogtreecommitdiffstats
path: root/src/fat_dir.c
diff options
context:
space:
mode:
authorChristophe Grenier <grenier@cgsecurity.org>2010-11-29 07:38:22 +0100
committerChristophe Grenier <grenier@cgsecurity.org>2010-11-29 07:38:22 +0100
commit3487a5c6037e9b2eba333716db78007a9e309984 (patch)
treea09d88f0491b2d51b1e81ca374dfdc17e2b8f09b /src/fat_dir.c
parentb1a8589162195dbdf67cffb63da5725e8ce1b7e3 (diff)
Check wctomb() availability
Diffstat (limited to 'src/fat_dir.c')
-rw-r--r--src/fat_dir.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/fat_dir.c b/src/fat_dir.c
index 2e83ff3..8b80a7c 100644
--- a/src/fat_dir.c
+++ b/src/fat_dir.c
@@ -81,7 +81,9 @@ file_data_t *dir_fat_aux(const unsigned char*buffer, const unsigned int size, co
unsigned int status;
unsigned int inode;
int utf8=1;
+#ifdef HAVE_WCTOMB
wctomb(NULL, 0);
+#endif
GetNew:
status=0;
long_slots = 0;
@@ -264,7 +266,11 @@ RecEnd:
{
if(utf8 && unicode[i]>0x7f)
{
+#ifdef HAVE_WCTOMB
const int sizec=wctomb(&new_file->name[o], unicode[i]);
+#else
+ const int sizec=unicode[i];
+#endif
if(sizec <= 0)
{
new_file->name[o]=(char) unicode[i];