Signed-off-by: Honggang Li <honli@xxxxxxxxxx> --- ibsim/sim_cmd.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/ibsim/sim_cmd.c b/ibsim/sim_cmd.c index 1d36c600814f..0a94c68bdf21 100644 --- a/ibsim/sim_cmd.c +++ b/ibsim/sim_cmd.c @@ -1149,11 +1149,16 @@ int sim_cmd_file(FILE * f, char *s) FILE *cmd_file; char *p; + if (!s) { + fprintf(f, "do_cmd_from_file: no file name - skip\n"); + return -1; + } + s++; while (isspace(*s)) s++; - if (!s || !*s) { + if (!*s) { fprintf(f, "do_cmd_from_file: no file name - skip\n"); return -1; } -- 2.15.0-rc1