X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=obt%2Fpaths.c;h=b20eb48d1139459cbaf2e99e9bb0b497528494e2;hb=ab7673c8167d94bdb93bd9905d6265dd3bf727b3;hp=e2e4859b8d94385053c1f50bcf46a172bdc71b5e;hpb=262591ec1adc1badfcb36e9e6876dd81f2df9492;p=chaz%2Fopenbox diff --git a/obt/paths.c b/obt/paths.c index e2e4859b..b20eb48d 100644 --- a/obt/paths.c +++ b/obt/paths.c @@ -126,7 +126,7 @@ static void find_uid_gid(uid_t *u, gid_t **g, guint *n) } endgrent(); - qsort(*g, sizeof(gid_t), *n, gid_cmp); + qsort(*g, *n, sizeof(gid_t), gid_cmp); } ObtPaths* obt_paths_new(void) @@ -331,7 +331,8 @@ static inline gboolean try_exec(const ObtPaths *const p, struct stat st; BSEARCH_SETUP(guint); - stat(path, &st); + if (stat(path, &st) != 0) + return FALSE; if (!S_ISREG(st.st_mode)) return FALSE;