lib: Use all_zero where appropriate
authorVolker Lendecke <vl@samba.org>
Thu, 19 Oct 2017 15:52:31 +0000 (17:52 +0200)
committerJeremy Allison <jra@samba.org>
Fri, 27 Oct 2017 18:33:25 +0000 (20:33 +0200)
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
lib/util/util.c

index ef148e98d29d5cdd2ef7d164858bacda8ea6e8e2..4291bfa5d57f8f08e4ee2dd8c33749cf25fb7bc1 100644 (file)
@@ -434,7 +434,6 @@ void dump_data_cb(const uint8_t *buf, int len,
                  void *private_data)
 {
        int i=0;
-       static const uint8_t empty[16] = { 0, };
        bool skipped = false;
        char tmp[16];
 
@@ -446,7 +445,7 @@ void dump_data_cb(const uint8_t *buf, int len,
                        if ((omit_zero_bytes == true) &&
                            (i > 0) &&
                            (len > i+16) &&
-                           (memcmp(&buf[i], &empty, 16) == 0))
+                           all_zero(&buf[i], 16))
                        {
                                i +=16;
                                continue;
@@ -473,7 +472,7 @@ void dump_data_cb(const uint8_t *buf, int len,
 
                        if ((omit_zero_bytes == true) &&
                            (len > i+16) &&
-                           (memcmp(&buf[i], &empty, 16) == 0)) {
+                           all_zero(&buf[i], 16)) {
                                if (!skipped) {
                                        cb("skipping zero buffer bytes\n",
                                           private_data);