Format source code.

This commit is contained in:
Jordan Bancino 2023-04-16 17:51:52 +00:00
parent 4ee66ae3c7
commit 582df63a31
3 changed files with 15 additions and 14 deletions

View file

@ -70,7 +70,7 @@ ROUTE_IMPL(RouteUiaFallback, path, argp)
{
HttpResponseStatus(args->context, HTTP_NOT_FOUND);
StreamPrintf(stream,
"<p>Unknown auth type: <code>%s</code></p>", authType);
"<p>Unknown auth type: <code>%s</code></p>", authType);
}
HtmlEnd(stream);

View file

@ -689,7 +689,7 @@ UserDeleteTokens(User * user, char *exempt)
}
int
UserGetPrivileges(User *user)
UserGetPrivileges(User * user)
{
if (!user)
{
@ -700,7 +700,7 @@ UserGetPrivileges(User *user)
}
int
UserSetPrivileges(User *user, int privileges)
UserSetPrivileges(User * user, int privileges)
{
JsonValue *val;
@ -726,7 +726,7 @@ UserSetPrivileges(User *user, int privileges)
}
int
UserDecodePrivileges(JsonValue *val)
UserDecodePrivileges(JsonValue * val)
{
int privileges = USER_NONE;
@ -740,17 +740,17 @@ UserDecodePrivileges(JsonValue *val)
if (JsonValueType(val) == JSON_ARRAY)
{
arr = JsonValueAsArray(val);
for (i = 0; i < ArraySize(arr); i++)
arr = JsonValueAsArray(val);
for (i = 0; i < ArraySize(arr); i++)
{
val = ArrayGet(arr, i);
if (!val || JsonValueType(val) != JSON_STRING)
{
val = ArrayGet(arr, i);
if (!val || JsonValueType(val) != JSON_STRING)
{
continue;
}
privileges |= UserDecodePrivilege(JsonValueAsString(val));
continue;
}
privileges |= UserDecodePrivilege(JsonValueAsString(val));
}
}
finish:
@ -794,6 +794,7 @@ JsonValue *
UserEncodePrivileges(int privileges)
{
Array *arr = ArrayCreate();
if (!arr)
{
return NULL;

View file

@ -40,7 +40,7 @@ typedef struct RegTokenInfo
unsigned long created;
unsigned long expires;
int grants; /* privileges */
int grants; /* privileges */
} RegTokenInfo;