mirror of
https://github.com/ostreedev/ostree.git
synced 2025-02-02 13:47:38 +03:00
prepare-root: Check for empty string, not strlen > 0
No point in doing a full strlen, we can just check the first byte. Also, invert the conditional using `continue` to avoid another level of indentation.
This commit is contained in:
parent
bea5d897a8
commit
678bfcd934
@ -332,15 +332,15 @@ load_composefs_config (GKeyFile *config, GError **error)
|
|||||||
for (char **iter = lines; *iter; iter++)
|
for (char **iter = lines; *iter; iter++)
|
||||||
{
|
{
|
||||||
const char *line = *iter;
|
const char *line = *iter;
|
||||||
if (strlen (line) > 0)
|
if (!*line)
|
||||||
{
|
continue;
|
||||||
|
|
||||||
gsize pubkey_size;
|
gsize pubkey_size;
|
||||||
g_autofree guchar *pubkey = g_base64_decode (line, &pubkey_size);
|
g_autofree guchar *pubkey = g_base64_decode (line, &pubkey_size);
|
||||||
ret->pubkeys = g_list_append (
|
ret->pubkeys = g_list_append (
|
||||||
ret->pubkeys, g_bytes_new_take (g_steal_pointer (&pubkey), pubkey_size));
|
ret->pubkeys, g_bytes_new_take (g_steal_pointer (&pubkey), pubkey_size));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if (ret->pubkeys == NULL)
|
if (ret->pubkeys == NULL)
|
||||||
return glnx_null_throw (error, "public key file specified, but no public keys found");
|
return glnx_null_throw (error, "public key file specified, but no public keys found");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user