Message ID | 20190102131318.5765-19-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: > Issue was detected by Coverity. > > Error: CLANG_WARNING: [#def3] > ibsim-0.7/ibsim/sim_cmd.c:540:3: warning: Value stored to 'n' is never read > // n += sprintf(comment+n, "\t# err_attr %d", port->errattr); > // ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > ibsim-0.7/ibsim/sim_cmd.c:540:3: note: Value stored to 'n' is never read > // n += sprintf(comment+n, "\t# err_attr %d", port->errattr); > // ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > // 538| n += sprintf(comment, "\t# err_rate %d", port->errrate); > // 539| if (port->errattr) > // 540|-> n += sprintf(comment+n, "\t# err_attr %d", port->errattr); > // 541| } > // 542| > > Signed-off-by: Honggang Li <honli@redhat.com> Thanks. Applied. -- Hal
diff --git a/ibsim/sim_cmd.c b/ibsim/sim_cmd.c index 0a94c68bdf21..325292103caa 100644 --- a/ibsim/sim_cmd.c +++ b/ibsim/sim_cmd.c @@ -537,7 +537,7 @@ static void dump_comment(Port * port, char *comment) if (port->errrate) n += sprintf(comment, "\t# err_rate %d", port->errrate); if (port->errattr) - n += sprintf(comment+n, "\t# err_attr %d", port->errattr); + sprintf(comment+n, "\t# err_attr %d", port->errattr); } static void dump_port(FILE * f, Port * port, int type)
Issue was detected by Coverity. Error: CLANG_WARNING: [#def3] ibsim-0.7/ibsim/sim_cmd.c:540:3: warning: Value stored to 'n' is never read // n += sprintf(comment+n, "\t# err_attr %d", port->errattr); // ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ibsim-0.7/ibsim/sim_cmd.c:540:3: note: Value stored to 'n' is never read // n += sprintf(comment+n, "\t# err_attr %d", port->errattr); // ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // 538| n += sprintf(comment, "\t# err_rate %d", port->errrate); // 539| if (port->errattr) // 540|-> n += sprintf(comment+n, "\t# err_attr %d", port->errattr); // 541| } // 542| Signed-off-by: Honggang Li <honli@redhat.com> --- ibsim/sim_cmd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)