diff options
author | Takuji Tanaka <KXD02663@nifty.ne.jp> | 2015-08-23 11:16:32 +0000 |
---|---|---|
committer | Takuji Tanaka <KXD02663@nifty.ne.jp> | 2015-08-23 11:16:32 +0000 |
commit | aebd8396c735335e0db69b8152073da6b68d17f9 (patch) | |
tree | 9fcb2ceb1eae2baa612512b4f86c306fc8d3cf0f /Build | |
parent | 35e1fcf00be8bcbb614978046b714a3f2425dc3f (diff) |
texk/mendexk: Bug fix (segmentation fault) due to r.38182
git-svn-id: svn://tug.org/texlive/trunk@38186 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build')
-rw-r--r-- | Build/source/texk/mendexk/fwrite.c | 4 | ||||
-rw-r--r-- | Build/source/texk/mendexk/main.c | 6 |
2 files changed, 5 insertions, 5 deletions
diff --git a/Build/source/texk/mendexk/fwrite.c b/Build/source/texk/mendexk/fwrite.c index 66dd1fcfba0..ee5fee0b8e3 100644 --- a/Build/source/texk/mendexk/fwrite.c +++ b/Build/source/texk/mendexk/fwrite.c @@ -124,7 +124,7 @@ void indwrite(char *filename, struct index *ind, int pagenum) FILE *fp; int conv_euc_to_euc; - if (filename[0]!='\0' && kpse_out_name_ok(filename)) fp=fopen(filename,"wb"); + if (filename && kpse_out_name_ok(filename)) fp=fopen(filename,"wb"); else { fp=stdout; #ifdef WIN32 @@ -303,7 +303,7 @@ void indwrite(char *filename, struct index *ind, int pagenum) } fputs(postamble,fp); - if (filename[0]!='\0') fclose(fp); + if (filename) fclose(fp); } /* write page block */ diff --git a/Build/source/texk/mendexk/main.c b/Build/source/texk/mendexk/main.c index 3790a79b0cd..739b449d9f6 100644 --- a/Build/source/texk/mendexk/main.c +++ b/Build/source/texk/mendexk/main.c @@ -278,11 +278,11 @@ int main(int argc, char **argv) } if (i==-1) sprintf(logfile,"%s.ilg",idxfile[0]); } - if ((logfile[0] != '\0') && kpse_out_name_ok(logfile)) + if (logfile && kpse_out_name_ok(logfile)) efp=fopen(logfile,"wb"); if(efp == NULL) { efp=stderr; - strcpy(logfile,"stderr"); + logfile=xstrdup("stderr"); } if (strcmp(argv[0],"makeindex")==0) { @@ -399,7 +399,7 @@ int main(int argc, char **argv) verb_printf(efp,"...done.\n"); - if (idxcount-fsti==0) strcpy(indfile,"stdout"); + if (idxcount-fsti==0) indfile=xstrdup("stdout"); verb_printf(efp,"%d warnings, written in %s.\n",warn,logfile); verb_printf(efp,"Output written in %s.\n",indfile); |