]> git.ipfire.org Git - thirdparty/openvpn.git/commit
options.c: fix broken unary minus usage
authorLev Stipakov <lev@openvpn.net>
Thu, 11 Oct 2018 11:51:42 +0000 (14:51 +0300)
committerGert Doering <gert@greenie.muc.de>
Thu, 11 Oct 2018 17:38:45 +0000 (19:38 +0200)
commited31cf2ab718d879615dea81e6a17d26537ab43a
treecf930b267b2f8ceab0c4f5f99645183685111459
parentb081038c7464f7a916560b4a71ebc83537a84b9d
options.c: fix broken unary minus usage

In Visual Studio when unary minus is applied to unsigned,
result is still unsigned. This means that when we use result
as function formal parameter, we pass incorrect value.

Fix by introducing frame_remove_from_extra_frame(),
which makes code semantically more clear and eliminates
the need in negative value and cast.

Since GCC didn't complain (and users too :), it probably performed
cast to signed automatically.

Signed-off-by: Lev Stipakov <lev@openvpn.net>
Acked-by: Gert Doering <gert@greenie.muc.de>
Message-Id: <1539258702-15427-1-git-send-email-lstipakov@gmail.com>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg17739.html
Signed-off-by: Gert Doering <gert@greenie.muc.de>
src/openvpn/crypto.c
src/openvpn/crypto.h
src/openvpn/mtu.h
src/openvpn/options.c
src/openvpn/ssl.c