Skip to content

Commit

Permalink
no magic numbers
Browse files Browse the repository at this point in the history
  • Loading branch information
danewalton-msft committed Sep 13, 2022
1 parent bfe1c88 commit c6b1425
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions sdk/src/azure/core/az_base64.c
Original file line number Diff line number Diff line change
Expand Up @@ -380,18 +380,18 @@ static int32_t _get_base64_decoded_char(int32_t index, _az_base64_mode mode)
{
if (mode == _az_base64_mode_url)
{
if (index == 43 || index == 47)
if (index == '+' || index == '/')
{
return -1; // can't use + or / with URL encoding
}

if (index == 45)
if (index == '-')
{
index = 43; // - becomes a +
index = '+'; // - becomes a +
}
else if (index == 95)
else if (index == '_')
{
index = 47; // _ becomes a /
index = '/'; // _ becomes a /
}
}

Expand Down

0 comments on commit c6b1425

Please sign in to comment.