No need to operate on full bit width (CID 1355344 / 1355348)

When giving the full bit width to sign extend there's nothing
left, so return the value straight away (a NULL op).

Change-Id: I48e6612b6a7c89c0a9ddad0974bb83e7c8e0c22d
Reviewed-on: https://code.wireshark.org/review/14390
Petri-Dish: Jaap Keuter <jaap.keuter@xs4all.nl>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Reviewed-by: Michael Mann <mmann78@netscape.net>
This commit is contained in:
Jaap Keuter 2016-03-07 22:21:35 +01:00 committed by Michael Mann
parent ec2c9a1e61
commit df551b8cb7
1 changed files with 2 additions and 2 deletions

View File

@ -32,7 +32,7 @@ ws_sign_ext32(guint32 val, int no_of_bits)
{
g_assert (no_of_bits >= 0 && no_of_bits <= 32);
if (no_of_bits == 0)
if ((no_of_bits == 0) || (no_of_bits == 32))
return val;
/*
@ -52,7 +52,7 @@ ws_sign_ext64(guint64 val, int no_of_bits)
{
g_assert (no_of_bits >= 0 && no_of_bits <= 64);
if (no_of_bits == 0)
if ((no_of_bits == 0) || (no_of_bits == 64))
return val;
/*