Permission: remove nullptr check
Both callers pass non-nullptr.
This commit is contained in:
parent
a4effeb3f9
commit
7ece8ff85c
@ -29,6 +29,7 @@
|
|||||||
|
|
||||||
#include <glib.h>
|
#include <glib.h>
|
||||||
|
|
||||||
|
#include <assert.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
static constexpr char PERMISSION_PASSWORD_CHAR = '@';
|
static constexpr char PERMISSION_PASSWORD_CHAR = '@';
|
||||||
@ -45,12 +46,11 @@ static unsigned permission_default;
|
|||||||
|
|
||||||
static unsigned parsePermissions(const char *string)
|
static unsigned parsePermissions(const char *string)
|
||||||
{
|
{
|
||||||
|
assert(string != nullptr);
|
||||||
|
|
||||||
unsigned permission = 0;
|
unsigned permission = 0;
|
||||||
gchar **tokens;
|
gchar **tokens;
|
||||||
|
|
||||||
if (!string)
|
|
||||||
return 0;
|
|
||||||
|
|
||||||
tokens = g_strsplit(string, PERMISSION_SEPERATOR, 0);
|
tokens = g_strsplit(string, PERMISSION_SEPERATOR, 0);
|
||||||
for (unsigned i = 0; tokens[i] != NULL; ++i) {
|
for (unsigned i = 0; tokens[i] != NULL; ++i) {
|
||||||
char *temp = tokens[i];
|
char *temp = tokens[i];
|
||||||
|
Loading…
Reference in New Issue
Block a user