Message ID | 20190102131318.5765-12-honli@redhat.com (mailing list archive) |
---|---|
State | Not Applicable |
Headers | show |
Series | [ibsim,01/23] move sim_cmd_file into ibsim/sim_cmd.c | expand |
On 1/2/2019 8:13 AM, Honggang Li wrote:
> Signed-off-by: Honggang Li <honli@redhat.com>
Thanks. Applied.
-- Hal
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; }
Signed-off-by: Honggang Li <honli@redhat.com> --- ibsim/sim_cmd.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)