From e7829c1a57014f8b40b4972ab5b45dbcf4bb067d Mon Sep 17 00:00:00 2001 From: rubidium Date: Mon, 29 Sep 2008 16:27:02 +0000 Subject: (svn r14414) -Fix: replace instances of strncpy with strecpy as strncpy doesn't guarantee the resulting string is '\0'-terminated. --- src/video/dedicated_v.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/video/dedicated_v.cpp') diff --git a/src/video/dedicated_v.cpp b/src/video/dedicated_v.cpp index 08fd87d28..6577bd6b7 100644 --- a/src/video/dedicated_v.cpp +++ b/src/video/dedicated_v.cpp @@ -226,7 +226,8 @@ static void DedicatedHandleKeyInput() if (fgets(input_line, lengthof(input_line), stdin) == NULL) return; #else /* Handle console input, and singal console thread, it can accept input again */ - strncpy(input_line, _win_console_thread_buffer, lengthof(input_line)); + assert_compile(lengthof(_win_console_thread_buffer) <= lengthof(input_line)); + strcpy(input_line, _win_console_thread_buffer); SetEvent(_hWaitForInputHandling); #endif -- cgit v1.2.3-54-g00ecf