git: 97452b097a4a - main - examples/inotify: Handle a zero-length name
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Mon, 07 Jul 2025 14:00:22 UTC
The branch main has been updated by markj:
URL: https://cgit.FreeBSD.org/src/commit/?id=97452b097a4a35df8ce8cbd44786fb7d95db2a92
commit 97452b097a4a35df8ce8cbd44786fb7d95db2a92
Author: Mark Johnston <markj@FreeBSD.org>
AuthorDate: 2025-07-07 13:51:41 +0000
Commit: Mark Johnston <markj@FreeBSD.org>
CommitDate: 2025-07-07 13:51:41 +0000
examples/inotify: Handle a zero-length name
Reported by: jlduran
Fixes: 1d8664d69041 ("examples: Add a demo program for inotify")
---
share/examples/inotify/inotify.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/share/examples/inotify/inotify.c b/share/examples/inotify/inotify.c
index b8e300bc992c..ea63ccd1f337 100644
--- a/share/examples/inotify/inotify.c
+++ b/share/examples/inotify/inotify.c
@@ -154,7 +154,7 @@ main(int argc, char **argv)
ev = ev2str(iev1->mask);
xo_open_instance("event");
xo_emit("{:wd/%3d} {:event/%16s} {:name/%s}\n",
- iev1->wd, ev, iev1->name);
+ iev1->wd, ev, iev1->len > 0 ? iev1->name : "");
xo_close_instance("event");
n -= sizeof(*iev1) + iev1->len;