From a1336f454c3c2a323bb973dd3446cf4e500c4935 Mon Sep 17 00:00:00 2001 From: Sylvain GENIN Date: Mon, 25 May 2015 15:51:46 +0200 Subject: [PATCH] if the variable does not exist then an error message to indicate this test_run("io","bug_11997",["no_check_error_output" ]); Change-Id: I8e434ebe943dab0ee7781f0ebde56a9d8f60d047 --- scilab/modules/io/sci_gateway/c/sci_save.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/scilab/modules/io/sci_gateway/c/sci_save.c b/scilab/modules/io/sci_gateway/c/sci_save.c index 29ae2a6..e8b57f8 100644 --- a/scilab/modules/io/sci_gateway/c/sci_save.c +++ b/scilab/modules/io/sci_gateway/c/sci_save.c @@ -78,8 +78,15 @@ int sci_save(char *fname, void *pvApiCtx) //try to get variable by name sciErr = getVarAddressFromName(pvApiCtx, pstVarI, &piAddrI2); freeAllocatedSingleString(pstVarI); + + if (sciErr.iErr != 0) + { + Scierror(999, _("Wrong value for argument #%d: Valid variable name expected.\n"), 3); + return 1; + } + pstVarI = NULL; - if (sciErr.iErr || piAddrI2 == NULL) + if (piAddrI2 == NULL) { // Try old save because here the input variable can be of type "string" but not a variable name // Ex: a=""; save(filename, a); -- 1.7.9.5