diff options
| author | 2014-10-08 14:57:22 +0300 | |
|---|---|---|
| committer | 2014-10-08 14:57:22 +0300 | |
| commit | 1734a96745f54c4b53a0adef2ca03d9389339314 (patch) | |
| tree | 7da72686a6bcf8a4c748eeccb14d7846270d8efe | |
| parent | f56dec0a4f24de60f85199b95691852a79a349b2 (diff) | |
| download | nnn-1734a96745f54c4b53a0adef2ca03d9389339314.tar.gz | |
No need for strncmp(3), use strcmp(3) instead
| -rw-r--r-- | noice.c | 10 |
1 files changed, 5 insertions, 5 deletions
@@ -88,7 +88,7 @@ openwith(char *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 @@ begin: 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 @@ redraw: * 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 @@ nochange: } if (ret == 2) { /* Handle root case */ - if (strncmp(path, "", 1) == 0) { + if (strcmp(path, "") == 0) { goto nochange; } else { char *dir, *tmp; |