[glib: 1/4] dirent: Simplify a memset() call
- From: Sebastian Dröge <sdroege src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glib: 1/4] dirent: Simplify a memset() call
- Date: Fri, 23 Apr 2021 08:40:22 +0000 (UTC)
commit 3c027268a4fe0dab76b2b661263a67eb676cabbd
Author: Philip Withnall <pwithnall endlessos org>
Date: Mon Apr 19 19:22:33 2021 +0100
dirent: Simplify a memset() call
Let the compiler figure out the size, rather than hard-coding it the
same as the struct definition.
This makes no functional changes.
Signed-off-by: Philip Withnall <pwithnall endlessos org>
glib/dirent/dirent.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
---
diff --git a/glib/dirent/dirent.c b/glib/dirent/dirent.c
index 26b6cb1e5..5b8f3ff80 100644
--- a/glib/dirent/dirent.c
+++ b/glib/dirent/dirent.c
@@ -135,7 +135,7 @@ _topendir (const _TCHAR *szPath)
nd->dd_dir.d_ino = 0;
nd->dd_dir.d_reclen = 0;
nd->dd_dir.d_namlen = 0;
- memset (nd->dd_dir.d_name, 0, FILENAME_MAX);
+ memset (nd->dd_dir.d_name, 0, sizeof (nd->dd_dir.d_name));
return nd;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]