Message ID | 1370377419-31788-5-git-send-email-alevy@redhat.com |
---|---|
State | New |
Headers | show |
On 4 June 2013 21:23, Alon Levy <alevy@redhat.com> wrote: > Found by Coverity. > > Signed-off-by: Alon Levy <alevy@redhat.com> > --- > libcacard/vscclient.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/libcacard/vscclient.c b/libcacard/vscclient.c > index 5180d29..4275c23 100644 > --- a/libcacard/vscclient.c > +++ b/libcacard/vscclient.c > @@ -645,7 +645,7 @@ main( > GIOChannel *channel_stdin; > char *qemu_host; > char *qemu_port; > - VSCMsgHeader mhHeader; > + VSCMsgHeader mhHeader = {0,}; As far as I can see we only use this variable once: send_msg(VSC_Init, mhHeader.reader_id, &init, sizeof(init)); so wouldn't it be better just to directly pass a constant "0" to the send_msg() call? Hiding a single uint32_t in a struct seems a bit obscure. thanks -- PMM
diff --git a/libcacard/vscclient.c b/libcacard/vscclient.c index 5180d29..4275c23 100644 --- a/libcacard/vscclient.c +++ b/libcacard/vscclient.c @@ -645,7 +645,7 @@ main( GIOChannel *channel_stdin; char *qemu_host; char *qemu_port; - VSCMsgHeader mhHeader; + VSCMsgHeader mhHeader = {0,}; VCardEmulOptions *command_line_options = NULL;
Found by Coverity. Signed-off-by: Alon Levy <alevy@redhat.com> --- libcacard/vscclient.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)