From 7823df83433efa9ab7490ce9bcb020deb72e8063 Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Thu, 31 Oct 2019 14:00:35 +0100 Subject: [PATCH] options: Define constants as unsigned in ssh_bind_options_set() Fixes T188 Signed-off-by: Andreas Schneider Reviewed-by: Jakub Jelen --- src/options.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/options.c b/src/options.c index 9c1a478f..0371750b 100644 --- a/src/options.c +++ b/src/options.c @@ -1805,12 +1805,12 @@ int ssh_bind_options_set(ssh_bind sshbind, enum ssh_bind_options_e type, return -1; } else { int *x = (int *) value; - sshbind->bindport = *x & 0xffff; + sshbind->bindport = *x & 0xffffU; } break; case SSH_BIND_OPTIONS_BINDPORT_STR: if (value == NULL) { - sshbind->bindport = 22 & 0xffff; + sshbind->bindport = 22 & 0xffffU; } else { q = strdup(value); if (q == NULL) { @@ -1823,7 +1823,7 @@ int ssh_bind_options_set(ssh_bind sshbind, enum ssh_bind_options_e type, } SAFE_FREE(q); - sshbind->bindport = i & 0xffff; + sshbind->bindport = i & 0xffffU; } break; case SSH_BIND_OPTIONS_LOG_VERBOSITY: @@ -1832,7 +1832,7 @@ int ssh_bind_options_set(ssh_bind sshbind, enum ssh_bind_options_e type, return -1; } else { int *x = (int *) value; - ssh_set_log_level(*x & 0xffff); + ssh_set_log_level(*x & 0xffffU); } break; case SSH_BIND_OPTIONS_LOG_VERBOSITY_STR: @@ -1850,7 +1850,7 @@ int ssh_bind_options_set(ssh_bind sshbind, enum ssh_bind_options_e type, } SAFE_FREE(q); - ssh_set_log_level(i & 0xffff); + ssh_set_log_level(i & 0xffffU); } break; case SSH_BIND_OPTIONS_DSAKEY: