diff options
Diffstat (limited to 'Build/source/texk/dvi2tty/dvi2tty-5.3.4')
-rw-r--r-- | Build/source/texk/dvi2tty/dvi2tty-5.3.4/disdvi.c | 5 | ||||
-rw-r--r-- | Build/source/texk/dvi2tty/dvi2tty-5.3.4/dvi2tty.c | 17 | ||||
-rw-r--r-- | Build/source/texk/dvi2tty/dvi2tty-5.3.4/dvi2tty.h | 2 |
3 files changed, 18 insertions, 6 deletions
diff --git a/Build/source/texk/dvi2tty/dvi2tty-5.3.4/disdvi.c b/Build/source/texk/dvi2tty/dvi2tty-5.3.4/disdvi.c index b6c8743384d..43403e0f339 100644 --- a/Build/source/texk/dvi2tty/dvi2tty-5.3.4/disdvi.c +++ b/Build/source/texk/dvi2tty/dvi2tty-5.3.4/disdvi.c @@ -193,7 +193,10 @@ int main(int argc, char **argv) if ((i >= 5) && (!strcmp(*argv+i-4, dvi_ext))) dvi_name = *argv; else { - dvi_name = malloc((i+5) * sizeof(char)); + if ((dvi_name = malloc((i+5) * sizeof(char))) == NULL) { + perror("dvi_name"); + exit(1); + } strcpy(dvi_name, *argv); strcat(dvi_name, dvi_ext); } diff --git a/Build/source/texk/dvi2tty/dvi2tty-5.3.4/dvi2tty.c b/Build/source/texk/dvi2tty/dvi2tty-5.3.4/dvi2tty.c index a77000c5c0a..54eac225c97 100644 --- a/Build/source/texk/dvi2tty/dvi2tty-5.3.4/dvi2tty.c +++ b/Build/source/texk/dvi2tty/dvi2tty-5.3.4/dvi2tty.c @@ -53,7 +53,6 @@ /*------------------ end of customization constants ---------------------*/ -#define MAXLEN 100 /* size of char-arrays for strings */ #if defined(MSDOS) || defined(VMS) || defined(AMIGA) #define OPTSET "haJweEpPousltvbcANU" /* legal options */ #define OPTWARG "weEpPovb" /* options with argument */ @@ -109,7 +108,7 @@ const char * path; /* name of the pager to run */ char * progname; /* our name */ int Argc; char ** Argv; -char DVIfilename[MAXLEN]; +char * DVIfilename; const char * OUTfilename; char optch; /* for option handling */ @@ -483,7 +482,10 @@ void getpages(int j, const char *str) int num; pageswitchon = TRUE; - firstpage = (printlisttype *) malloc(sizeof(printlisttype)); + if ((firstpage = (printlisttype *) malloc(sizeof(printlisttype))) == NULL) { + perror("firstpage"); + exit(1); + } firstpage->all = FALSE; firstpage->nxt = nil; firstpage->pag = 0; @@ -543,7 +545,10 @@ void plcnxt(int pagnr) currentpage = lastpage; currentpage->pag = pagnr; - lastpage = (printlisttype *) malloc(sizeof(printlisttype)); + if ((lastpage = (printlisttype *) malloc(sizeof(printlisttype))) == NULL) { + perror("lastpage"); + exit(1); + } lastpage->all = FALSE; lastpage->nxt = nil; lastpage->pag = 0; @@ -566,6 +571,10 @@ void getfname(const char *str) i = strlen(str); if (i == 0) usage(ign); + if ((DVIfilename = (char *) malloc(i+5)) == NULL) { + perror("DVIfilename"); + exit(1); + } strcpy(DVIfilename, str); #ifdef KPATHSEA if (!kpse_readable_file(DVIfilename)) diff --git a/Build/source/texk/dvi2tty/dvi2tty-5.3.4/dvi2tty.h b/Build/source/texk/dvi2tty/dvi2tty-5.3.4/dvi2tty.h index 924c467c725..21825f95db3 100644 --- a/Build/source/texk/dvi2tty/dvi2tty-5.3.4/dvi2tty.h +++ b/Build/source/texk/dvi2tty/dvi2tty-5.3.4/dvi2tty.h @@ -28,7 +28,7 @@ Copyright (C) 1989-2010 M.J.E. Mol, MESA Consulting B.V." #include <stdio.h> #include <string.h> #include <stdlib.h> -#if defined(MSDOS) +#if defined(MSDOS) || (defined(WIN32) && !defined(__MINGW32__)) # include <malloc.h> #else # if !defined(THINK_C) |