diff --git a/src/interface.c b/src/interface.c
index e2b1d0bd6..742272bdb 100644
--- a/src/interface.c
+++ b/src/interface.c
@@ -4977,7 +4977,7 @@ int search_results(char *str, int votes)
 		}
 		else if (!strncmp(str, "MOTD ", 5))
 		{
-			memcpy(server_motd, str+5, strlen(str+5));
+			strncpy(server_motd, str+5, 511);
 		}
 		else if (!strncmp(str, "TAG ", 4))
 		{