return immediately if empty commands are sent

This commit is contained in:
Holger Vogt 2019-09-20 19:22:47 +02:00
parent 2426a037db
commit acd0c7156c
1 changed files with 10 additions and 0 deletions

View File

@ -916,6 +916,16 @@ immediately */
IMPEXP
int ngSpice_Command(char* comexec)
{
/* Check if command is reasonable */
if (comexec == NULL) {
fprintf(stderr, "Warning: Received command NULL, ignored");
return 1;
}
if (*comexec == '\0') {
fprintf(stderr, "Warning: Received empty string as command, ignored");
return 1;
}
if ( ! setjmp(errbufc) ) {
immediate = FALSE;