diff options
author | Akira Kakuto <kakuto@fuk.kindai.ac.jp> | 2016-11-12 14:01:21 +0000 |
---|---|---|
committer | Akira Kakuto <kakuto@fuk.kindai.ac.jp> | 2016-11-12 14:01:21 +0000 |
commit | e9c4ff8c8a5ff7dda8f5d0ab98bed2b270caefff (patch) | |
tree | 911a75a3b9d1dfca9683c2f6dba2a72a0321d3a5 /Build/source/texk/mendexk/main.c | |
parent | 1129993c8ce70ee984a6306b5e22972b82b063e2 (diff) |
mendexk: Avoid access violation on Windows
git-svn-id: svn://tug.org/texlive/trunk@42490 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/texk/mendexk/main.c')
-rw-r--r-- | Build/source/texk/mendexk/main.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/Build/source/texk/mendexk/main.c b/Build/source/texk/mendexk/main.c index 739b449d9f6..776888c8f5a 100644 --- a/Build/source/texk/mendexk/main.c +++ b/Build/source/texk/mendexk/main.c @@ -268,16 +268,18 @@ int main(int argc, char **argv) } if (!logfile && (idxcount-fsti > 0)) { - logfile=xmalloc(strlen(idxfile[0]+6)); + char llogfile[512]; + for (i=0; i < 512; i++) llogfile[i] = '\0'; for (i=strlen(idxfile[0]);i>=0;i--) { if (idxfile[0][i]=='.') { - strncpy(logfile,idxfile[0],i); - sprintf(&logfile[i],".ilg"); + strncpy(llogfile,idxfile[0],i); + sprintf(&llogfile[i],".ilg"); break; } } - if (i==-1) sprintf(logfile,"%s.ilg",idxfile[0]); - } + if (i==-1) sprintf(llogfile,"%s.ilg",idxfile[0]); + logfile = xstrdup(llogfile); + } if (logfile && kpse_out_name_ok(logfile)) efp=fopen(logfile,"wb"); if(efp == NULL) { |