From 8fb9de41d5669147a8b514c5950a1b05f64e477e Mon Sep 17 00:00:00 2001 From: Jim Meyering Date: Sat, 20 May 2006 22:18:16 +0000 Subject: (fts_open): Fail with EINVAL if a caller violates this rule: Either FTS_LOGICAL or FTS_PHYSICAL must be provided to the fts_open() function. --- lib/fts.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'lib') diff --git a/lib/fts.c b/lib/fts.c index 2d4e33321..5ea139700 100644 --- a/lib/fts.c +++ b/lib/fts.c @@ -291,6 +291,10 @@ fts_open (char * const *argv, __set_errno (EINVAL); return (NULL); } + if ( ! (options & (FTS_LOGICAL | FTS_PHYSICAL))) { + __set_errno (EINVAL); + return (NULL); + } /* Allocate/initialize the stream */ if ((sp = malloc(sizeof(FTS))) == NULL) -- cgit v1.2.3-54-g00ecf