librpc: Use the MAX() macro where appropriate
authorVolker Lendecke <vl@samba.org>
Tue, 21 Jan 2020 12:20:07 +0000 (13:20 +0100)
committerJeremy Allison <jra@samba.org>
Thu, 23 Jan 2020 19:11:34 +0000 (19:11 +0000)
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
librpc/ndr/ndr.c

index ec90bbabd9dc3cdea6a0c780fdf1bf7ff3b91964..74bc038c6f2c809518396a1c8aa6b88e71699062 100644 (file)
@@ -1326,11 +1326,7 @@ _PUBLIC_ enum ndr_err_code ndr_pull_struct_blob_all_noalloc(const DATA_BLOB *blo
        };
        uint32_t highest_ofs;
        NDR_CHECK(fn(&ndr, NDR_SCALARS|NDR_BUFFERS, p));
-       if (ndr.offset > ndr.relative_highest_offset) {
-               highest_ofs = ndr.offset;
-       } else {
-               highest_ofs = ndr.relative_highest_offset;
-       }
+       highest_ofs = MAX(ndr.offset, ndr.relative_highest_offset);
        if (highest_ofs < ndr.data_size) {
                enum ndr_err_code ret;
                ret = ndr_pull_error(&ndr, NDR_ERR_UNREAD_BYTES,