summaryrefslogtreecommitdiff
path: root/Build/source/texk/mendexk/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'Build/source/texk/mendexk/main.c')
-rw-r--r--Build/source/texk/mendexk/main.c12
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) {