acl-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Acl-devel] [PATCH] attr: Replace bzero with memset


From: Rosen Penev
Subject: [Acl-devel] [PATCH] attr: Replace bzero with memset
Date: Sun, 11 Aug 2019 16:17:11 -0700

bzero is a deprecated function that is optionally unavailable with
uClibc-ng.

Signed-off-by: Rosen Penev <address@hidden>
---
 libattr/libattr.c | 4 ++--
 tools/attr.c      | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/libattr/libattr.c b/libattr/libattr.c
index d550e10..2ebd1c5 100644
--- a/libattr/libattr.c
+++ b/libattr/libattr.c
@@ -298,7 +298,7 @@ attr_list(const char *path, char *buffer, const int 
buffersize, int flags,
                errno = EINVAL;
                return -1;
        }
-       bzero(buffer, sizeof(attrlist_t));
+       memset(buffer, 0, sizeof(attrlist_t));
 
        if (flags & ATTR_DONTFOLLOW)
                length = llistxattr(path, lbuf, sizeof(lbuf) - 1);
@@ -349,7 +349,7 @@ attr_listf(int fd, char *buffer, const int buffersize, int 
flags,
                errno = EINVAL;
                return -1;
        }
-       bzero(buffer, sizeof(attrlist_t));
+       memset(buffer, 0, sizeof(attrlist_t));
 
        length = flistxattr(fd, lbuf, sizeof(lbuf) - 1);
        if (length < 0)
diff --git a/tools/attr.c b/tools/attr.c
index c8aa0b4..e048f2f 100644
--- a/tools/attr.c
+++ b/tools/attr.c
@@ -228,7 +228,7 @@ main(int argc, char **argv)
                        perror("malloc");
                        exit(1);
                }
-               bzero((char *)&cursor, sizeof(cursor));
+               memset((char *)&cursor, 0, sizeof(cursor));
                do {
                        error = attr_list(filename, buffer, BUFSIZE,
                                          attrflags, &cursor);
-- 
2.17.1




reply via email to

[Prev in Thread] Current Thread [Next in Thread]