diff options
Diffstat (limited to 'apps/plugins/lib/highscore.c')
-rw-r--r-- | apps/plugins/lib/highscore.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/apps/plugins/lib/highscore.c b/apps/plugins/lib/highscore.c index e8e1c883b0..15ebb05f4d 100644 --- a/apps/plugins/lib/highscore.c +++ b/apps/plugins/lib/highscore.c | |||
@@ -72,7 +72,7 @@ int highscore_load(char *filename, struct highscore *scores, int num_scores) | |||
72 | 72 | ||
73 | scores[i].score = rb->atoi(score); | 73 | scores[i].score = rb->atoi(score); |
74 | scores[i].level = rb->atoi(level); | 74 | scores[i].level = rb->atoi(level); |
75 | rb->strncpy(scores[i].name, name, sizeof(scores[i].name)-1); | 75 | rb->strlcpy(scores[i].name, name, sizeof(scores[i].name)); |
76 | i++; | 76 | i++; |
77 | } | 77 | } |
78 | rb->close(fd); | 78 | rb->close(fd); |
@@ -100,8 +100,7 @@ int highscore_update(int score, int level, const char *name, | |||
100 | entry = scores + pos; | 100 | entry = scores + pos; |
101 | entry->score = score; | 101 | entry->score = score; |
102 | entry->level = level; | 102 | entry->level = level; |
103 | rb->strncpy(entry->name, name, sizeof(entry->name)); | 103 | rb->strlcpy(entry->name, name, sizeof(entry->name)); |
104 | entry->name[sizeof(entry->name)-1] = '\0'; | ||
105 | 104 | ||
106 | return pos; | 105 | return pos; |
107 | } | 106 | } |