mirror of
https://github.com/SELinuxProject/selinux
synced 2025-01-11 07:59:26 +00:00
libsepol: Replace constant with sizeof()
Replace constant 18 with safer use of sizeof() Signed-off-by: Unto Sten <sten.unto@gmail.com>
This commit is contained in:
parent
e8d880e0a2
commit
eb2a875747
@ -448,7 +448,7 @@ static int write_sids_to_conf(FILE *out, const char *const *sid_to_str,
|
||||
if (i < num_sids) {
|
||||
sid = (char *)sid_to_str[i];
|
||||
} else {
|
||||
snprintf(unknown, 18, "%s%u", "UNKNOWN", i);
|
||||
snprintf(unknown, sizeof(unknown), "%s%u", "UNKNOWN", i);
|
||||
sid = strdup(unknown);
|
||||
if (!sid) {
|
||||
rc = -1;
|
||||
@ -2376,7 +2376,7 @@ static int write_sid_context_rules_to_conf(FILE *out, struct policydb *pdb, cons
|
||||
if (i < num_sids) {
|
||||
sid = (char *)sid_to_str[i];
|
||||
} else {
|
||||
snprintf(unknown, 18, "%s%u", "UNKNOWN", i);
|
||||
snprintf(unknown, sizeof(unknown), "%s%u", "UNKNOWN", i);
|
||||
sid = unknown;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user