summaryrefslogtreecommitdiff
path: root/Build/source/texk/kpathsea/knj.c
diff options
context:
space:
mode:
authorTakuji Tanaka <KXD02663@nifty.ne.jp>2014-01-01 00:27:26 +0000
committerTakuji Tanaka <KXD02663@nifty.ne.jp>2014-01-01 00:27:26 +0000
commit487202a1d0438bdf1ce4eacadd8c254963d095b3 (patch)
treea532f67ed394e015744affc350108b9941d2cbca /Build/source/texk/kpathsea/knj.c
parent86eee27b59637d600f33de8a39048a692a234a64 (diff)
Use cast for ASCII string conversion from char to wchar_t (Windows only)
git-svn-id: svn://tug.org/texlive/trunk@32530 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/texk/kpathsea/knj.c')
-rw-r--r--Build/source/texk/kpathsea/knj.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/Build/source/texk/kpathsea/knj.c b/Build/source/texk/kpathsea/knj.c
index 1073c76bbb0..e077aac7ad7 100644
--- a/Build/source/texk/kpathsea/knj.c
+++ b/Build/source/texk/kpathsea/knj.c
@@ -1,7 +1,7 @@
/* knj.c: check for 2-Byte Kanji (CP 932, SJIS) codes.
Copyright 2010, 2011 Akira Kakuto.
- Copyright 2013 TANAKA Takuji.
+ Copyright 2013, 2014 TANAKA Takuji.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
@@ -103,13 +103,14 @@ fsyscp_xfopen (const char *filename, const char *mode)
{
FILE *f;
wchar_t *fnamew, modew[4];
+ int i;
#if defined (KPSE_COMPAT_API)
kpathsea kpse;
#endif
assert(filename && mode);
fnamew = get_wstring_from_fsyscp(filename, fnamew=NULL);
- get_wstring_from_fsyscp(mode, modew);
+ for(i=0; modew[i]=(wchar_t)mode[i]; i++) {} /* mode[i] must be ASCII */
f = _wfopen(fnamew, modew);
if (f == NULL)
FATAL_PERROR(filename);
@@ -136,13 +137,14 @@ fsyscp_fopen (const char *filename, const char *mode)
{
FILE *f;
wchar_t *fnamew, modew[4];
+ int i;
#if defined (KPSE_COMPAT_API)
kpathsea kpse;
#endif
assert(filename && mode);
fnamew = get_wstring_from_fsyscp(filename, fnamew=NULL);
- get_wstring_from_fsyscp(mode, modew);
+ for(i=0; modew[i]=(wchar_t)mode[i]; i++) {} /* mode[i] must be ASCII */
f = _wfopen(fnamew, modew);
#if defined (KPSE_COMPAT_API)
if (f != NULL) {