noice.c | 10 +++++----- diff --git a/noice.c b/noice.c index 0e6a000ab79f12774a1f95ae5abeb9fd898208a9..c69e85ee397329d47138e8078dcab2188239b231 100644 --- a/noice.c +++ b/noice.c @@ -88,7 +88,7 @@ ext = file; DPRINTF_S(ext); for (i = 0; i < LEN(assocs); i++) - if (strncmp(assocs[i].ext, ext, strlen(ext) + 1) == 0) + if (strcmp(assocs[i].ext, ext) == 0) bin = assocs[i].bin; DPRINTF_S(bin); @@ -245,8 +245,8 @@ } while ((dp = readdir(dirp)) != NULL) { /* Skip self and parent */ - if (strncmp(dp->d_name, ".", 2) == 0 - || strncmp(dp->d_name, "..", 3) == 0) + if (strcmp(dp->d_name, ".") == 0 + || strcmp(dp->d_name, "..") == 0) continue; dents = realloc(dents, (n + 1) * sizeof(*dents)); if (dents == NULL) @@ -295,7 +295,7 @@ /* Print cwd. If empty we are on the root. We store it * as an empty string so that when we navigate in /mnt * is doesn't come up as //mnt. */ printw(CWD "%s%s\n\n", - strncmp(cwd, "", 1) == 0 ? "/" : "", + strcmp(cwd, "") == 0 ? "/" : "", cwd); /* Print listing */ @@ -328,7 +328,7 @@ return; } if (ret == 2) { /* Handle root case */ - if (strncmp(path, "", 1) == 0) { + if (strcmp(path, "") == 0) { goto nochange; } else { char *dir, *tmp;