libndr: Avoid ommitting display of unset bitmap flags.
authorGünther Deschner <gd@samba.org>
Wed, 9 Oct 2013 15:47:29 +0000 (17:47 +0200)
committerGünther Deschner <gd@samba.org>
Wed, 9 Oct 2013 17:56:39 +0000 (19:56 +0200)
In 816e68f94fe500b9d68fd29021d432b84d3139b7 the display of unset bits has been
effectively disabled while only the check for 0 bits was supposed to be avoided
(because it creates the infite loop).

Guenther

Signed-off-by: Günther Deschner <gd@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Autobuild-User(master): Günther Deschner <gd@samba.org>
Autobuild-Date(master): Wed Oct  9 19:56:39 CEST 2013 on sn-devel-104

librpc/ndr/ndr_basic.c

index ae5af7a4a5fe076221347422d99417fd44a2170e..a6cf607f3eb89ae4f37f4e9a00e9bfb472e3a73e 100644 (file)
@@ -1017,13 +1017,13 @@ _PUBLIC_ void ndr_print_enum(struct ndr_print *ndr, const char *name, const char
 
 _PUBLIC_ void ndr_print_bitmap_flag(struct ndr_print *ndr, size_t size, const char *flag_name, uint32_t flag, uint32_t value)
 {
-       /* this is an attempt to support multi-bit bitmap masks */
-       value &= flag;
-
-       if (value == 0) {
+       if (flag == 0) {
                return;
        }
 
+       /* this is an attempt to support multi-bit bitmap masks */
+       value &= flag;
+
        while (!(flag & 1)) {
                flag >>= 1;
                value >>= 1;