Lines 716-734
Link Here
|
716 |
{ |
716 |
{ |
717 |
char *tmp, *ptr; |
717 |
char *tmp, *ptr; |
718 |
MALLOC(tmp, char, FILENAME_LEN); |
718 |
MALLOC(tmp, char, FILENAME_LEN); |
719 |
snprintf(tmp, FILENAME_LEN, v); |
719 |
snprintf(tmp, FILENAME_LEN, "%s", v); |
720 |
if ((ptr = strrchr(tmp, '.'))) // if there's a filename extension, kill it. No one knows it's the right one. |
720 |
if ((ptr = strrchr(tmp, '.'))) // if there's a filename extension, kill it. No one knows it's the right one. |
721 |
*ptr = '\0'; |
721 |
*ptr = '\0'; |
722 |
strncat(tmp, ".tex", sizeof(char)*FILENAME_LEN); // apply tex-extenstion |
722 |
strncat(tmp, ".tex", sizeof(char)*FILENAME_LEN); // apply tex-extenstion |
723 |
if (cfexist(tmp)) // check if this file exists ... |
723 |
if (cfexist(tmp)) // check if this file exists ... |
724 |
snprintf(Briefing_text_filename, FILENAME_LEN, tmp); // ... and apply ... |
724 |
snprintf(Briefing_text_filename, FILENAME_LEN, "%s", tmp); // ... and apply ... |
725 |
else // ... otherwise ... |
725 |
else // ... otherwise ... |
726 |
{ |
726 |
{ |
727 |
if ((ptr = strrchr(tmp, '.'))) |
727 |
if ((ptr = strrchr(tmp, '.'))) |
728 |
*ptr = '\0'; |
728 |
*ptr = '\0'; |
729 |
strncat(tmp, ".txb", sizeof(char)*FILENAME_LEN); // apply txb extension |
729 |
strncat(tmp, ".txb", sizeof(char)*FILENAME_LEN); // apply txb extension |
730 |
if (cfexist(tmp)) // check if this file exists ... |
730 |
if (cfexist(tmp)) // check if this file exists ... |
731 |
snprintf(Briefing_text_filename, FILENAME_LEN, tmp); // ... and apply ... |
731 |
snprintf(Briefing_text_filename, FILENAME_LEN, "%s", tmp); // ... and apply ... |
732 |
} |
732 |
} |
733 |
d_free(tmp); |
733 |
d_free(tmp); |
734 |
} |
734 |
} |
Lines 741-759
Link Here
|
741 |
{ |
741 |
{ |
742 |
char *tmp, *ptr; |
742 |
char *tmp, *ptr; |
743 |
MALLOC(tmp, char, FILENAME_LEN); |
743 |
MALLOC(tmp, char, FILENAME_LEN); |
744 |
snprintf(tmp, FILENAME_LEN, v); |
744 |
snprintf(tmp, FILENAME_LEN, "%s", v); |
745 |
if ((ptr = strrchr(tmp, '.'))) // if there's a filename extension, kill it. No one knows it's the right one. |
745 |
if ((ptr = strrchr(tmp, '.'))) // if there's a filename extension, kill it. No one knows it's the right one. |
746 |
*ptr = '\0'; |
746 |
*ptr = '\0'; |
747 |
strncat(tmp, ".tex", sizeof(char)*FILENAME_LEN); // apply tex-extenstion |
747 |
strncat(tmp, ".tex", sizeof(char)*FILENAME_LEN); // apply tex-extenstion |
748 |
if (cfexist(tmp)) // check if this file exists ... |
748 |
if (cfexist(tmp)) // check if this file exists ... |
749 |
snprintf(Briefing_text_filename, FILENAME_LEN, tmp); // ... and apply ... |
749 |
snprintf(Briefing_text_filename, FILENAME_LEN, "%s", tmp); // ... and apply ... |
750 |
else // ... otherwise ... |
750 |
else // ... otherwise ... |
751 |
{ |
751 |
{ |
752 |
if ((ptr = strrchr(tmp, '.'))) |
752 |
if ((ptr = strrchr(tmp, '.'))) |
753 |
*ptr = '\0'; |
753 |
*ptr = '\0'; |
754 |
strncat(tmp, ".txb", sizeof(char)*FILENAME_LEN); // apply txb extension |
754 |
strncat(tmp, ".txb", sizeof(char)*FILENAME_LEN); // apply txb extension |
755 |
if (cfexist(tmp)) // check if this file exists ... |
755 |
if (cfexist(tmp)) // check if this file exists ... |
756 |
snprintf(Ending_text_filename, FILENAME_LEN, tmp); // ... and apply ... |
756 |
snprintf(Ending_text_filename, FILENAME_LEN, "%s", tmp); // ... and apply ... |
757 |
} |
757 |
} |
758 |
d_free(tmp); |
758 |
d_free(tmp); |
759 |
} |
759 |
} |