_findnext() not working properly

I'm trying to get all the files in a directory with the same extension. Eventually _findnext is called and set errno to ENOENT which equals 2. When debugging, the value even says it is 2. How come it is still returning err in this code?
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
	while ( searching )
	{
		if ( _findnext( hSearch, &fInfo ) == -1 )
		{
			if ( _get_errno( &err ) == ENOENT )
			{
				searching = false;
				_set_errno( NULL );
			}
			else
			{
				return err;
			}
		}
		defsNames.push_back( fInfo.name );
	}
Last edited on
Because you don't understand what _get_errno is returning.
Thanks, working now.
Topic archived. No new replies allowed.