From af46754ef137e6bed4863061c7bf6e616d79b48b Mon Sep 17 00:00:00 2001 From: Stathis Kamperis Date: Sat, 4 Aug 2007 01:13:35 +0300 Subject: [PATCH] Add comment regarding newpath malloc() --- kqueue/kqdir.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/kqueue/kqdir.c b/kqueue/kqdir.c index 6e868b9..cbf314e 100755 --- a/kqueue/kqdir.c +++ b/kqueue/kqdir.c @@ -57,7 +57,9 @@ int main(int argc, char *argv[]) goto CLEANUP_AND_EXIT; } - /* check path length */ + /* check path length + don't forget +1 for the '\0' + */ if (strlen(argv[1] + strlen(pdent->d_name) + 2) > 256) { fprintf(stderr,"Max path length exceeded\n"); goto CLEANUP_AND_EXIT; -- 2.11.4.GIT