diff options
author | Todd C. Miller <millert@cvs.openbsd.org> | 2003-03-18 16:55:55 +0000 |
---|---|---|
committer | Todd C. Miller <millert@cvs.openbsd.org> | 2003-03-18 16:55:55 +0000 |
commit | dfbb771c83664afc246a3834d4ec17f3169b5989 (patch) | |
tree | a6062cdd0136c3b4f82635b600a22a9bb6099569 /lib/libcurses/tinfo/access.c | |
parent | 9504d3161dd42533b38ffc7e455b079baddb6032 (diff) |
Use strlcpy() / strlcat() throughout.
Diffstat (limited to 'lib/libcurses/tinfo/access.c')
-rw-r--r-- | lib/libcurses/tinfo/access.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/libcurses/tinfo/access.c b/lib/libcurses/tinfo/access.c index 7a2bc501c50..a4a184e699c 100644 --- a/lib/libcurses/tinfo/access.c +++ b/lib/libcurses/tinfo/access.c @@ -57,14 +57,14 @@ _nc_access(const char *path, int mode) if ((mode & W_OK) != 0 && errno == ENOENT && strlen(path) < PATH_MAX) { - char head[PATH_MAX]; - char *leaf = _nc_basename(strcpy(head, path)); + char *leaf, head[PATH_MAX]; - if (leaf == 0) + strlcpy(head, path, sizeof(head)); + if ((leaf = _nc_basename(head)) == 0) leaf = head; *leaf = '\0'; if (head == leaf) - (void) strcpy(head, "."); + (void) strlcpy(head, ".", sizeof(head)); return access(head, R_OK | W_OK | X_OK); } |