Merge pull request #29848 from poettering/base64url-too

hexdecoct: implicitly parse URL-safe base64 format, too
This commit is contained in:
Luca Boccassi
2023-11-03 23:26:33 +00:00
committed by GitHub
2 changed files with 31 additions and 2 deletions
+2 -2
View File
@@ -553,12 +553,12 @@ int unbase64char(char c) {
offset += '9' - '0' + 1;
if (c == '+')
if (IN_SET(c, '+', '-')) /* Support both the regular and the URL safe character set (see above) */
return offset;
offset++;
if (c == '/')
if (IN_SET(c, '/', '_')) /* ditto */
return offset;
return -EINVAL;