diff options
author | Markus Uhlin <markus@nifty-networks.net> | 2023-12-25 04:06:39 +0100 |
---|---|---|
committer | Markus Uhlin <markus@nifty-networks.net> | 2023-12-25 04:06:39 +0100 |
commit | 378ff84d1ecf4bb18eb90de6904d8a0210b79b83 (patch) | |
tree | 3e88a2233c7ace341bc661124ccb8632c2cada6f | |
parent | 890af4dbb320b9185181689d521db4622cf98db9 (diff) |
Usage of sizeof
-rw-r--r-- | FICS/playerdb.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/FICS/playerdb.c b/FICS/playerdb.c index d60d401..fafa0af 100644 --- a/FICS/playerdb.c +++ b/FICS/playerdb.c @@ -401,7 +401,7 @@ ReadV1PlayerFmt(int p, player *pp, FILE *fp, char *file, int version) pp->l_stats.sterr = (ls / 10.0); pp->bug_stats.sterr = (bugs / 10.0); - fgets(tmp2, MAX_STRING_LENGTH, fp); + fgets(tmp2, sizeof tmp2, fp); tmp2[strlen(tmp2) - 1] = '\0'; pp->prompt = xstrdup(tmp2); @@ -422,7 +422,7 @@ ReadV1PlayerFmt(int p, player *pp, FILE *fp, char *file, int version) if (pp->num_plan > 0) { for (i = 0; i < pp->num_plan; i++) { - fgets(tmp2, MAX_LINE_SIZE, fp); + fgets(tmp2, sizeof tmp2, fp); if (!(len = strlen(tmp2))) { fprintf(stderr, "FICS: Error bad plan in " @@ -440,7 +440,7 @@ ReadV1PlayerFmt(int p, player *pp, FILE *fp, char *file, int version) if (pp->num_formula > 0) { for (i = 0; i < pp->num_formula; i++) { - fgets(tmp2, MAX_LINE_SIZE, fp); + fgets(tmp2, sizeof tmp2, fp); if (!(len = strlen(tmp2))) { fprintf(stderr, "FICS: Error bad formula in " @@ -456,7 +456,7 @@ ReadV1PlayerFmt(int p, player *pp, FILE *fp, char *file, int version) } } - fgets(tmp2, MAX_LINE_SIZE, fp); + fgets(tmp2, sizeof tmp2, fp); tmp2[strlen(tmp2) - 1] = '\0'; if (!strcmp(tmp2, "NONE")) @@ -466,7 +466,7 @@ ReadV1PlayerFmt(int p, player *pp, FILE *fp, char *file, int version) if (pp->numAlias > 0) { for (i = 0; i < pp->numAlias; i++) { - fgets(tmp2, MAX_LINE_SIZE, fp); + fgets(tmp2, sizeof tmp2, fp); if (!(len = strlen(tmp2))) { fprintf(stderr, "FICS: Error bad alias in " |