summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--configure.ac2
-rw-r--r--src/fat_dir.c6
2 files changed, 7 insertions, 1 deletions
diff --git a/configure.ac b/configure.ac
index 1c8a527..6c63c60 100644
--- a/configure.ac
+++ b/configure.ac
@@ -668,7 +668,7 @@ case "$target" in
;;
esac
-AC_CHECK_FUNCS([atexit atoll chdir chmod delscreen dirname dup2 execv ftruncate fsync getcwd geteuid lstat memalign memset mkdir posix_fadvise posix_memalign pwrite readlink setenv setlocale sigaction signal sleep snprintf strchr strdup strerror strncasecmp strtol touchwin utime vsnprintf])
+AC_CHECK_FUNCS([atexit atoll chdir chmod delscreen dirname dup2 execv ftruncate fsync getcwd geteuid lstat memalign memset mkdir posix_fadvise posix_memalign pwrite readlink setenv setlocale sigaction signal sleep snprintf strchr strdup strerror strncasecmp strtol touchwin utime vsnprintf wctomb])
if test "$ac_cv_func_mkdir" = "no"; then
AC_MSG_ERROR(No mkdir function detected)
fi
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];