Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 196673 | Differences between
and this patch

Collapse All | Expand All

(-)tetex-src-2.0.2/texk/makeindexk/mkind.c (-7 / +15 lines)
Lines 179-185 char *argv[]; Link Here
179
		    argc--;
179
		    argc--;
180
		    if (argc <= 0)
180
		    if (argc <= 0)
181
			FATAL("Expected -p <num>\n","");
181
			FATAL("Expected -p <num>\n","");
182
		    strcpy(pageno, *++argv);
182
		    if (strlen(*++argv) >= sizeof(pageno))
183
			FATAL("Page number too high\n","");
184
		    strcpy(pageno, *argv);
183
		    init_page = TRUE;
185
		    init_page = TRUE;
184
		    if (STREQ(pageno, EVEN)) {
186
		    if (STREQ(pageno, EVEN)) {
185
			log_given = TRUE;
187
			log_given = TRUE;
Lines 230-236 char *argv[]; Link Here
230
		char tmp[STRING_MAX + 5];
232
		char tmp[STRING_MAX + 5];
231
		
233
		
232
		/* base set by last call to check_idx */
234
		/* base set by last call to check_idx */
233
		sprintf (tmp, "%s%s", base, INDEX_STY);
235
		snprintf (tmp, sizeof(tmp), "%s%s", base, INDEX_STY);
234
		if (0 == access(tmp, R_OK)) {
236
		if (0 == access(tmp, R_OK)) {
235
			open_sty (tmp);
237
			open_sty (tmp);
236
			sty_given = TRUE;
238
			sty_given = TRUE;
Lines 405-413 int open_fn; Link Here
405
		    STRING_MAX,totmem);
407
		    STRING_MAX,totmem);
406
#endif /* DEBUG */
408
#endif /* DEBUG */
407
409
408
	    if ((idx_fn = (char *) malloc(STRING_MAX)) == NULL)
410
	    if ((idx_fn = (char *) malloc(STRING_MAX+5)) == NULL)
409
		FATAL("Not enough core...abort.\n", "");
411
		FATAL("Not enough core...abort.\n", "");
410
	    sprintf(idx_fn, "%s%s", base, INDEX_IDX);
412
	    snprintf(idx_fn, STRING_MAX+5, "%s%s", base, INDEX_IDX);
411
	    if ((open_fn && 
413
	    if ((open_fn && 
412
	 ((idx_fp = OPEN_IN(idx_fn)) == NULL)
414
	 ((idx_fp = OPEN_IN(idx_fn)) == NULL)
413
	) ||
415
	) ||
Lines 434-440 int log_given; Link Here
434
436
435
    /* index output file */
437
    /* index output file */
436
    if (!ind_given) {
438
    if (!ind_given) {
437
	sprintf(ind, "%s%s", base, INDEX_IND);
439
	snprintf(ind, sizeof(ind), "%s%s", base, INDEX_IND);
438
	ind_fn = ind;
440
	ind_fn = ind;
439
    }
441
    }
440
    if ((ind_fp = OPEN_OUT(ind_fn)) == NULL)
442
    if ((ind_fp = OPEN_OUT(ind_fn)) == NULL)
Lines 442-455 int log_given; Link Here
442
444
443
    /* index transcript file */
445
    /* index transcript file */
444
    if (!ilg_given) {
446
    if (!ilg_given) {
445
	sprintf(ilg, "%s%s", base, INDEX_ILG);
447
	snprintf(ilg, sizeof(ilg), "%s%s", base, INDEX_ILG);
446
	ilg_fn = ilg;
448
	ilg_fn = ilg;
447
    }
449
    }
448
    if ((ilg_fp = OPEN_OUT(ilg_fn)) == NULL)
450
    if ((ilg_fp = OPEN_OUT(ilg_fn)) == NULL)
449
	FATAL("Can't create transcript file %s.\n", ilg_fn);
451
	FATAL("Can't create transcript file %s.\n", ilg_fn);
450
452
451
    if (log_given) {
453
    if (log_given) {
452
	sprintf(log_fn, "%s%s", base, INDEX_LOG);
454
	snprintf(log_fn, sizeof(log_fn), "%s%s", base, INDEX_LOG);
453
	if ((log_fp = OPEN_IN(log_fn)) == NULL) {
455
	if ((log_fp = OPEN_IN(log_fn)) == NULL) {
454
	    FATAL("Source log file %s not found.\n", log_fn);
456
	    FATAL("Source log file %s not found.\n", log_fn);
455
	} else {
457
	} else {
Lines 505-510 char *fn; Link Here
505
  if ((found = kpse_find_file (fn, kpse_ist_format, 1)) == NULL) {
507
  if ((found = kpse_find_file (fn, kpse_ist_format, 1)) == NULL) {
506
     FATAL("Index style file %s not found.\n", fn);
508
     FATAL("Index style file %s not found.\n", fn);
507
  } else {
509
  } else {
510
    if (strlen(found) >= sizeof(sty_fn)) {
511
      FATAL("Style file %s too long.\n", found);
512
    }
508
    strcpy(sty_fn,found);
513
    strcpy(sty_fn,found);
509
    if ((sty_fp = OPEN_IN(sty_fn)) == NULL) {
514
    if ((sty_fp = OPEN_IN(sty_fn)) == NULL) {
510
      FATAL("Could not open style file %s.\n", sty_fn);
515
      FATAL("Could not open style file %s.\n", sty_fn);
Lines 512-517 char *fn; Link Here
512
  }
517
  }
513
#else
518
#else
514
    if ((path = getenv(STYLE_PATH)) == NULL) {
519
    if ((path = getenv(STYLE_PATH)) == NULL) {
520
        if (strlen(fn) >= sizeof(sty_fn)) {
521
          FATAL("Style file %s too long.\n", fn);
522
        }
515
	/* style input path not defined */
523
	/* style input path not defined */
516
	strcpy(sty_fn, fn);
524
	strcpy(sty_fn, fn);
517
	sty_fp = OPEN_IN(sty_fn);
525
	sty_fp = OPEN_IN(sty_fn);

Return to bug 196673