qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] libcacard: Fix wrong assertion (reported by cppcheck)
@ 2011-10-19 19:03 Stefan Weil
  2011-10-19 22:42 ` Alon Levy
  0 siblings, 1 reply; 2+ messages in thread
From: Stefan Weil @ 2011-10-19 19:03 UTC (permalink / raw)
  To: qemu-devel; +Cc: Stefan Weil, Alon Levy

assert("...") will never do anything. This assertion handles a case
which should never occur, so it must be assert(!"...").

Cc: Alon Levy <alevy@redhat.com>
Signed-off-by: Stefan Weil <sw@weilnetz.de>
---
 libcacard/card_7816.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/libcacard/card_7816.c b/libcacard/card_7816.c
index 9fd59d4..6fe27d5 100644
--- a/libcacard/card_7816.c
+++ b/libcacard/card_7816.c
@@ -754,7 +754,7 @@ vcard_process_apdu(VCard *card, VCardAPDU *apdu, VCardResponse **response)
         return vcard7816_vm_process_apdu(card, apdu, response);
     case VCARD_DIRECT:
         /* if we are type direct, then the applet should handle everything */
-        assert("VCARD_DIRECT: applet failure");
+        assert(!"VCARD_DIRECT: applet failure");
         break;
     }
     *response =
-- 
1.7.2.5

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [Qemu-devel] [PATCH] libcacard: Fix wrong assertion (reported by cppcheck)
  2011-10-19 19:03 [Qemu-devel] [PATCH] libcacard: Fix wrong assertion (reported by cppcheck) Stefan Weil
@ 2011-10-19 22:42 ` Alon Levy
  0 siblings, 0 replies; 2+ messages in thread
From: Alon Levy @ 2011-10-19 22:42 UTC (permalink / raw)
  To: Stefan Weil; +Cc: qemu-devel

On Wed, Oct 19, 2011 at 09:03:22PM +0200, Stefan Weil wrote:
> assert("...") will never do anything. This assertion handles a case
> which should never occur, so it must be assert(!"...").
> 

Thanks, I'll pick it up for a pull request.

> Cc: Alon Levy <alevy@redhat.com>
> Signed-off-by: Stefan Weil <sw@weilnetz.de>
> ---
>  libcacard/card_7816.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/libcacard/card_7816.c b/libcacard/card_7816.c
> index 9fd59d4..6fe27d5 100644
> --- a/libcacard/card_7816.c
> +++ b/libcacard/card_7816.c
> @@ -754,7 +754,7 @@ vcard_process_apdu(VCard *card, VCardAPDU *apdu, VCardResponse **response)
>          return vcard7816_vm_process_apdu(card, apdu, response);
>      case VCARD_DIRECT:
>          /* if we are type direct, then the applet should handle everything */
> -        assert("VCARD_DIRECT: applet failure");
> +        assert(!"VCARD_DIRECT: applet failure");
>          break;
>      }
>      *response =
> -- 
> 1.7.2.5
> 

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2011-10-19 22:45 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-10-19 19:03 [Qemu-devel] [PATCH] libcacard: Fix wrong assertion (reported by cppcheck) Stefan Weil
2011-10-19 22:42 ` Alon Levy

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).