diff options
author | Igor Pashev <pashev.igor@gmail.com> | 2022-10-28 04:00:00 +0200 |
---|---|---|
committer | Igor Pashev <pashev.igor@gmail.com> | 2022-10-29 11:57:20 +0200 |
commit | 8df721df25864f89772c58a4486314855bf1a37e (patch) | |
tree | 7c89253922a8f09b964876b438056e2655cc9062 /src/graph/viewAlone/spoon2D.c | |
parent | 467b6fb9eeb12d064c1f6fa4d7f87638e49685ca (diff) | |
download | open-axiom-8df721df25864f89772c58a4486314855bf1a37e.tar.gz |
Fix some compiler warnings & buffer overflows
Diffstat (limited to 'src/graph/viewAlone/spoon2D.c')
-rw-r--r-- | src/graph/viewAlone/spoon2D.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/graph/viewAlone/spoon2D.c b/src/graph/viewAlone/spoon2D.c index 00f46e31..912d834b 100644 --- a/src/graph/viewAlone/spoon2D.c +++ b/src/graph/viewAlone/spoon2D.c @@ -58,7 +58,7 @@ spoonView2D(void) { int i,code,pipe0[2],pipe1[2],there; - char envAXIOM[100],runView[100]; + char runView[100]; sprintf(errorStr,"%s","creating pipes"); check(pipe(pipe0)); @@ -84,8 +84,7 @@ spoonView2D(void) close(pipe1[1]); printf("(spoon2D child) start the TwoDimensionalViewport process\n"); sprintf(errorStr,"%s","(viewAlone) execution of the TwoDimensionalViewport process"); - sprintf(envAXIOM,"%s",oa_getenv("AXIOM")); - sprintf(runView,"%s%s",envAXIOM,"/lib/view2D"); + sprintf(runView,"%s/lib/view2D",oa_getenv("AXIOM")); check(execl(runView,runView, (char*)NULL)); fprintf(stderr,"Could not execute view2D! Check that view2D is on your path variable.\n"); exit(-1); @@ -215,7 +214,7 @@ makeView2DFromFileData(view2DStruct *doView2D) int i,j,k; char title[256]; FILE *graphFile; - char graphFilename[256]; + char graphFilename[512]; pointListStruct *aList; pointStruct *aPoint; printf("(spoon2D makeView2DFromFileData)\n"); @@ -280,7 +279,7 @@ makeView2DFromFileData(view2DStruct *doView2D) for (i=0; i<maxGraphs; i++) { if (graphArray[i].key) { /** OPEN FILE FOR GRAPHS **/ - sprintf(graphFilename,"%s%s%d",pathname,"/graph",i); + sprintf(graphFilename,"%s/graph%d",pathname,i); if ((graphFile = fopen(graphFilename,"r")) == NULL) { fprintf(stderr," Error: Cannot find the file %s\n",graphFilename); perror("fopen"); |