File highscore.diff of Package moon-buggy
--- highscore.c.bak 2004-12-27 17:14:40.000000000 +0100
+++ highscore.c 2009-08-19 14:06:50.000000000 +0200
@@ -207,7 +207,7 @@
highscore[i].date = convert_old_date (day, month, year);
highscore[i].name[0] = '\0';
highscore[i].new = 0;
- strncat (highscore[i].name, name, MAX_NAME_CHARS);
+ strncat (highscore[i].name, name, MAX_NAME_CHARS-strlen(highscore[i].name)-1);
}
qsort (highscore, HIGHSCORE_SLOTS, sizeof (struct score_entry),
compare_entries);
@@ -241,7 +241,7 @@
highscore[i].date = parse_date (date);
highscore[i].name[0] = '\0';
highscore[i].new = 0;
- strncat (highscore[i].name, name, MAX_NAME_CHARS);
+ strncat (highscore[i].name, name, MAX_NAME_CHARS-strlen(highscore[i].name)-1);
}
if (ferror (score_file)) {
print_message ("Error while reading score file");