aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarkus Uhlin <markus@nifty-networks.net>2024-12-02 20:56:52 +0100
committerMarkus Uhlin <markus@nifty-networks.net>2024-12-02 20:56:52 +0100
commit47ee7e8870884e01a3b5bef63094d30cbae59d52 (patch)
treedf82e057aca0175137e90947c0c2f3de891c8e2b
parent5742f90fdcbeda996e2dd69c5c3da2da99c44a41 (diff)
Usage of strcspn()
-rw-r--r--FICS/makerank.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/FICS/makerank.c b/FICS/makerank.c
index d851c53..05671ad 100644
--- a/FICS/makerank.c
+++ b/FICS/makerank.c
@@ -171,7 +171,7 @@ LoadEntries(void)
break;
len = strlen(e.name);
- e.name[len - 1] = '\0';
+ e.name[strcspn(e.name, "\n")] = '\0';
if (e.name[0] != letter1) {
printf("File %c/%s: wrong directory.\n",
@@ -226,7 +226,7 @@ SetComputers(int n)
feof(fpComp))
break;
- comp[strlen(comp) - 1] = '\0';
+ comp[strcspn(comp, "\n")] = '\0';
while (i < n && strcasecmp(list[i]->name, comp) < 0)
i++;