diff --git a/src/deh_soc.c b/src/deh_soc.c
index 646ec874436027ece44577446a820086f9d28f9c..07100e7036b04981439351188819b3327ccc1d0d 100644
--- a/src/deh_soc.c
+++ b/src/deh_soc.c
@@ -1234,7 +1234,7 @@ void readgametype(MYFILE *f, INT32 num)
 			else if (fastcmp(word, "IDENTIFIER"))
 			{
 				// GT_
-				strncpy(gtconst, word2, MAXLINELEN);
+				strlcpy(gtconst, word2, sizeof(gtconst));
 			}
 			// Point and time limits
 			else if (fastcmp(word, "DEFAULTPOINTLIMIT"))