diff options
author | Rosen Penev <rosenp@gmail.com> | 2019-08-11 16:17:11 -0700 |
---|---|---|
committer | Andreas Gruenbacher <agruenba@redhat.com> | 2019-08-12 10:40:59 +0200 |
commit | 0ce120a140dadaa56875af2efc66ff805d37925b (patch) | |
tree | 34984f9cfd6809d50a062b0c06402924386777ac | |
parent | 2ad8924413eeb8a2123eccccef4371342d19d6e4 (diff) | |
download | attr-0ce120a140dadaa56875af2efc66ff805d37925b.tar.gz |
attr: Replace bzero with memset
bzero is a deprecated function that is optionally unavailable with
uClibc-ng.
Signed-off-by: Rosen Penev <rosenp@gmail.com>
-rw-r--r-- | include/attributes.h | 4 | ||||
-rw-r--r-- | libattr/libattr.c | 4 | ||||
-rw-r--r-- | tools/attr.c | 2 |
3 files changed, 5 insertions, 5 deletions
diff --git a/include/attributes.h b/include/attributes.h index 14beb8f..039c817 100644 --- a/include/attributes.h +++ b/include/attributes.h @@ -91,9 +91,9 @@ typedef struct attrlist_ent { /* data from attr_list() */ * Implement a "cursor" for use in successive attr_list() calls. * It provides a way to find the last attribute that was returned in the * last attr_list() call so that we can get the next one without missing - * any. This should be bzero()ed before use and whenever it is desired to + * any. This should be zeroed before use and whenever it is desired to * start over from the beginning of the attribute list. The only valid - * operation on a cursor is to bzero() it. + * operation on a cursor is to zero it. */ typedef struct attrlist_cursor { uint32_t opaque[4]; /* an opaque cookie */ 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..312aef1 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(&cursor, 0, sizeof(cursor)); do { error = attr_list(filename, buffer, BUFSIZE, attrflags, &cursor); |