[libbluray-devel] Use sizeof()
hpi1
git at videolan.org
Thu Aug 21 11:31:24 CEST 2014
libbluray | branch: master | hpi1 <hpi1 at anonymous.org> | Thu Aug 21 12:29:07 2014 +0300| [726b02a81a1c74ed9c19c14734425435f7242faa] | committer: hpi1
Use sizeof()
> http://git.videolan.org/gitweb.cgi/libbluray.git/?a=commit;h=726b02a81a1c74ed9c19c14734425435f7242faa
---
src/file/dir_posix.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/file/dir_posix.c b/src/file/dir_posix.c
index ea63581..1114838 100644
--- a/src/file/dir_posix.c
+++ b/src/file/dir_posix.c
@@ -54,7 +54,7 @@ static int _dir_read_posix(BD_DIR_H *dir, BD_DIRENT *entry)
} else if (p_e == NULL) {
return 1;
}
- strncpy(entry->d_name, e.d_name, 256);
+ strncpy(entry->d_name, e.d_name, sizeof(entry->d_name));
entry->d_name[sizeof(entry->d_name) - 1] = 0;
return 0;
More information about the libbluray-devel
mailing list