Module: wine Branch: master Commit: c46300ff2834c6d7fc4eb059660c5d28554b5a54 URL: https://gitlab.winehq.org/wine/wine/-/commit/c46300ff2834c6d7fc4eb059660c5d2...
Author: Alex Henrie alexhenrie24@gmail.com Date: Sun Sep 24 12:05:29 2023 -0600
conhost: Use the wcsdup function instead of reimplementing it.
---
programs/conhost/conhost.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/programs/conhost/conhost.c b/programs/conhost/conhost.c index eb3c574789f..419d94c3eed 100644 --- a/programs/conhost/conhost.c +++ b/programs/conhost/conhost.c @@ -692,8 +692,7 @@ static WCHAR *edit_line_history( struct console *console, unsigned int index ) } else if(console->edit_line.current_history) { - if ((ptr = malloc( (lstrlenW(console->edit_line.current_history) + 1) * sizeof(WCHAR) ))) - lstrcpyW( ptr, console->edit_line.current_history ); + ptr = wcsdup( console->edit_line.current_history ); } return ptr; }