diff --git a/src/Routes/RouteUiaFallback.c b/src/Routes/RouteUiaFallback.c
index 2a74ce2..dfd7114 100644
--- a/src/Routes/RouteUiaFallback.c
+++ b/src/Routes/RouteUiaFallback.c
@@ -70,7 +70,7 @@ ROUTE_IMPL(RouteUiaFallback, path, argp)
{
HttpResponseStatus(args->context, HTTP_NOT_FOUND);
StreamPrintf(stream,
- "
Unknown auth type: %s
", authType);
+ "Unknown auth type: %s
", authType);
}
HtmlEnd(stream);
diff --git a/src/User.c b/src/User.c
index 4ec4562..d42edbb 100644
--- a/src/User.c
+++ b/src/User.c
@@ -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;
diff --git a/src/include/RegToken.h b/src/include/RegToken.h
index d9c08c8..b80e6b3 100644
--- a/src/include/RegToken.h
+++ b/src/include/RegToken.h
@@ -40,7 +40,7 @@ typedef struct RegTokenInfo
unsigned long created;
unsigned long expires;
- int grants; /* privileges */
+ int grants; /* privileges */
} RegTokenInfo;