From: Calixte DENIZET Date: Wed, 6 Nov 2013 11:57:06 +0000 (+0100) Subject: Graphics: avoid crash due to scope problem X-Git-Tag: 5.5.0~1165 X-Git-Url: http://gitweb.scilab.org/?p=scilab.git;a=commitdiff_plain;h=5c60d6e1f442c60a3178c562a1497dc7e33ca894;hp=129b7417d7e342beef601ff0f77018abd61ee14f Graphics: avoid crash due to scope problem Change-Id: Idd046800d6f46600237db0284aad90f9935c581c --- diff --git a/scilab/modules/graphics/sci_gateway/c/sci_champ.c b/scilab/modules/graphics/sci_gateway/c/sci_champ.c index 6a99f26..d84b68b 100644 --- a/scilab/modules/graphics/sci_gateway/c/sci_champ.c +++ b/scilab/modules/graphics/sci_gateway/c/sci_champ.c @@ -53,6 +53,7 @@ int sci_champ_G(char *fname, }; char * strf = NULL; + char strfl[4]; double* rect = NULL; int* piAddr1 = NULL; @@ -194,7 +195,6 @@ int sci_champ_G(char *fname, if (isDefStrf(strf)) { - char strfl[4]; strcpy(strfl, DEFSTRFN); strf = strfl; if (!isDefRect(rect)) diff --git a/scilab/modules/graphics/sci_gateway/c/sci_fec.c b/scilab/modules/graphics/sci_gateway/c/sci_fec.c index 4f2a3d8..80c6948 100644 --- a/scilab/modules/graphics/sci_gateway/c/sci_fec.c +++ b/scilab/modules/graphics/sci_gateway/c/sci_fec.c @@ -46,6 +46,7 @@ int sci_fec(char *fname, unsigned long fname_len) }; char* strf = NULL; + char strfl[4]; char* legend = NULL; double* rect = NULL; double* zminmax = NULL; @@ -188,8 +189,6 @@ int sci_fec(char *fname, unsigned long fname_len) if (isDefStrf (strf)) { - char strfl[4]; - strcpy(strfl, DEFSTRFN); strf = strfl; diff --git a/scilab/modules/graphics/sci_gateway/c/sci_grayplot.c b/scilab/modules/graphics/sci_gateway/c/sci_grayplot.c index 2c12d45..e39a70ad 100644 --- a/scilab/modules/graphics/sci_gateway/c/sci_grayplot.c +++ b/scilab/modules/graphics/sci_gateway/c/sci_grayplot.c @@ -46,6 +46,7 @@ int sci_grayplot(char *fname, unsigned long fname_len) }; char * strf = NULL ; + char strfl[4]; double* rect = NULL ; int * nax = NULL ; BOOL flagNax = FALSE; @@ -172,8 +173,6 @@ int sci_grayplot(char *fname, unsigned long fname_len) if (isDefStrf(strf)) { - char strfl[4]; - strcpy(strfl, DEFSTRFN); strf = strfl; diff --git a/scilab/modules/graphics/sci_gateway/c/sci_plot2d1.c b/scilab/modules/graphics/sci_gateway/c/sci_plot2d1.c index da4f513..10fe83f 100644 --- a/scilab/modules/graphics/sci_gateway/c/sci_plot2d1.c +++ b/scilab/modules/graphics/sci_gateway/c/sci_plot2d1.c @@ -80,6 +80,7 @@ int sci_plot2d1_G(char * fname, int ptype, unsigned long fname_len) int * nax = NULL ; BOOL flagNax = FALSE; char * strf = NULL ; + char strfl[4]; char * legend = NULL ; char * logFlags = NULL ; @@ -322,7 +323,6 @@ int sci_plot2d1_G(char * fname, int ptype, unsigned long fname_len) if (isDefStrf(strf)) { - char strfl[4]; strcpy(strfl, DEFSTRFN); strf = strfl;