libselinux: remove useless assignment and test
PATCH 1/1 libselinux: remove useless assignment and test
Signed-off-by Kalevi Kolttonen <[email protected]>
--- libselinux/src/label_support.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-)
libselinux/src/label_support.c +5 -7
@@ -190,13 +190,11 @@ int digest_add_specfile(struct selabel_digest *digest, FILE *fp, 1, buf_len, fp) != buf_len)return -1 ; - }else if (from_addr) { - tmp_buf =memcpy (digest->hashbuf + - (digest->hashbuf_size - buf_len), - from_addr, buf_len); -if (!tmp_buf) -return -1 ; - } + }else if (from_addr) +memcpy (digest->hashbuf + + (digest->hashbuf_size - buf_len), + from_addr, buf_len); +/* Now add path to list */ digest->specfile_list[digest->specfile_cnt] =strdup (path);if (!digest->specfile_list[digest->specfile_cnt])
Signature · 1 line
2.54.0
Quoted 2 lines · Kalevi Kolttonen
Signed-off-by Kalevi Kolttonen <[email protected]>
Acked-by James Carter <[email protected]>
Quoted 31 lines
--- libselinux/src/label_support.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-)libselinux/src/label_support.c +5
-8@@ -190,13 +190,11 @@ int digest_add_specfile(struct selabel_digest *digest, FILE *fp, 1, buf_len, fp) != buf_len)return -1 ; - }else if (from_addr) { - tmp_buf =memcpy (digest->hashbuf + - (digest->hashbuf_size - buf_len), - from_addr, buf_len); -if (!tmp_buf) -return -1 ; - } + }else if (from_addr) +memcpy (digest->hashbuf + + (digest->hashbuf_size - buf_len), + from_addr, buf_len); +/* Now add path to list */ digest->specfile_list[digest->specfile_cnt] =strdup (path);if (!digest->specfile_list[digest->specfile_cnt]) --2.54.0
Quoted 7 lines · James Carter
Quoted 2 lines · Kalevi Kolttonen
Signed-off-by Kalevi Kolttonen <[email protected]>Acked-by James Carter <[email protected]>
Merged.
Thanks,
Jim
Quoted 31 lines
Quoted 31 lines
--- libselinux/src/label_support.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-)libselinux/src/label_support.c +5
-8@@ -190,13 +190,11 @@ int digest_add_specfile(struct selabel_digest *digest, FILE *fp, 1, buf_len, fp) != buf_len)return -1 ; - }else if (from_addr) { - tmp_buf =memcpy (digest->hashbuf + - (digest->hashbuf_size - buf_len), - from_addr, buf_len); -if (!tmp_buf) -return -1 ; - } + }else if (from_addr) +memcpy (digest->hashbuf + + (digest->hashbuf_size - buf_len), + from_addr, buf_len); +/* Now add path to list */ digest->specfile_list[digest->specfile_cnt] =strdup (path);if (!digest->specfile_list[digest->specfile_cnt]) --2.54.0