diff options
| author | Keith Packard <keithp@keithp.com> | 2009-05-17 22:43:34 -0700 | 
|---|---|---|
| committer | Keith Packard <keithp@keithp.com> | 2009-05-17 22:43:34 -0700 | 
| commit | 33221277690e6ee30387c506c3f2b8237ed48efd (patch) | |
| tree | 461d9c71acc882ebb597c1c51b12e56b54bc9728 | |
| parent | 7cb9fb675f56bf30ab6bf0bcdc5cb679709ffe3e (diff) | |
scandir returns -1 on error
In which case, the namelist is invalid, so don't look at it, and don't free
it.
Signed-off-by: Keith Packard <keithp@keithp.com>
| -rw-r--r-- | aoview/aoview_dev.c | 2 | 
1 files changed, 1 insertions, 1 deletions
| diff --git a/aoview/aoview_dev.c b/aoview/aoview_dev.c index a326ad73..33f7f8ec 100644 --- a/aoview/aoview_dev.c +++ b/aoview/aoview_dev.c @@ -91,7 +91,7 @@ usb_tty(char *sys)  				       dir_filter_tty,  				       alphasort);  			free(endpoint_full); -			if (ntty) { +			if (ntty > 0) {  				tty = aoview_fullname("/dev", namelist[0]->d_name + 4);  				free(namelist);  				return tty; | 
