Skip to content
This repository was archived by the owner on Feb 9, 2020. It is now read-only.

Commit a3e7c68

Browse files
rogersmxenith
authored andcommitted
Remove unsafe strncpy and use safer snprintf. (#20)
1 parent 5e2825a commit a3e7c68

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/action_safe.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ void cmd_copyover(D_MOBILE *dMob, char *arg)
156156
return;
157157
}
158158

159-
strncpy(buf, "\n\r <*> The world starts spinning <*>\n\r", MAX_BUFFER);
159+
snprintf(buf, sizeof(buf), "%s", "\n\r <*> The world starts spinning <*>\n\r");
160160

161161
/* For each playing descriptor, save its state */
162162
AttachIterator(&Iter, dsock_list);

0 commit comments

Comments
 (0)