aboutsummaryrefslogtreecommitdiffstats
path: root/FICS
diff options
context:
space:
mode:
Diffstat (limited to 'FICS')
-rw-r--r--FICS/makerank.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/FICS/makerank.c b/FICS/makerank.c
index 01f95c5..dcac856 100644
--- a/FICS/makerank.c
+++ b/FICS/makerank.c
@@ -1,4 +1,6 @@
-/* Revised by maxxe 23/12/14 */
+/*
+ * Revised by maxxe 23/12/14
+ */
#include <ctype.h>
#include <err.h>
@@ -6,6 +8,10 @@
#include <stdlib.h>
#include <string.h>
+#if __linux__
+#include <bsd/string.h>
+#endif
+
#include "makerank.h"
static ENTRY **list;
@@ -72,8 +78,11 @@ GetPlayerInfo(char *fileName, ENTRY *e)
printf("TROUBLE: %s's handle is "
"listed as %s.\n", e->name,
NameWithCase);
- } else
- strcpy(e->name, NameWithCase);
+ } else if (strlcpy(e->name, NameWithCase,
+ sizeof e->name) >= sizeof e->name) {
+ fprintf(stderr, "%s: warning: "
+ "strlcpy() truncated\n", __func__);
+ }
} else if (!strcmp(field, "S_NUM:")) {
sscanf(line, "%*s %d", &(e->r[0].num));
} else if (!strcmp(field, "B_NUM:")) {