summaryrefslogtreecommitdiff
path: root/librpc
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2019-04-12 15:10:35 +1200
committerAndrew Bartlett <abartlet@samba.org>2019-04-12 04:38:14 +0000
commitc9e6331afc1ee0e85a9582c6682ff95885135792 (patch)
treed7c0be93400a1b0f9c1a57849a76cb9db35b67a4 /librpc
parent10dd15010bddb929128b3585f1280ae1eb7b6b99 (diff)
downloadsamba-c9e6331afc1ee0e85a9582c6682ff95885135792.tar.gz
ndrdump: change behaviour of flags to operate as flags
These are called flags because that is what they become to the ndr_pull function, but to avoid total confusion treat them as flags generally even if the values are always exclusive (at the moment). Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Diffstat (limited to 'librpc')
-rw-r--r--librpc/tools/ndrdump.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/librpc/tools/ndrdump.c b/librpc/tools/ndrdump.c
index b7eae70833e..ef7f9c66139 100644
--- a/librpc/tools/ndrdump.c
+++ b/librpc/tools/ndrdump.c
@@ -201,7 +201,7 @@ static void ndr_print_dummy(struct ndr_print *ndr, const char *format, ...)
struct ndr_pull *ndr_pull;
struct ndr_print *ndr_print;
TALLOC_CTX *mem_ctx;
- int flags;
+ int flags = 0;
poptContext pc;
NTSTATUS status;
enum ndr_err_code ndr_err;
@@ -316,10 +316,10 @@ static void ndr_print_dummy(struct ndr_print *ndr, const char *format, ...)
if (strcmp(inout, "in") == 0 ||
strcmp(inout, "request") == 0) {
- flags = NDR_IN;
+ flags |= NDR_IN;
} else if (strcmp(inout, "out") == 0 ||
strcmp(inout, "response") == 0) {
- flags = NDR_OUT;
+ flags |= NDR_OUT;
} else {
printf("Bad inout value '%s'\n", inout);
exit(1);
@@ -340,7 +340,7 @@ static void ndr_print_dummy(struct ndr_print *ndr, const char *format, ...)
}
if (ctx_filename) {
- if (flags == NDR_IN) {
+ if (flags & NDR_IN) {
printf("Context file can only be used for \"out\" packages\n");
exit(1);
}