From e42c24868c2d33924a46e7bd31be383092e05650 Mon Sep 17 00:00:00 2001 From: OBattler Date: Tue, 20 Mar 2018 20:32:14 +0100 Subject: [PATCH] Fixed one instance of the SPINNER configuration type handler to handle it correctly by using wide strings and then converting to narrow strings, fixes #270. --- src/win/win_devconf.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/win/win_devconf.c b/src/win/win_devconf.c index d738ab39e..5b1e80535 100644 --- a/src/win/win_devconf.c +++ b/src/win/win_devconf.c @@ -8,7 +8,7 @@ * * Windows device configuration dialog implementation. * - * Version: @(#)win_devconf.c 1.0.16 2018/03/18 + * Version: @(#)win_devconf.c 1.0.17 2018/03/20 * * Authors: Sarah Walker, * Miran Grca, @@ -241,7 +241,7 @@ deviceconfig_dlgproc(HWND hdlg, UINT message, WPARAM wParam, LPARAM lParam) val_int = config->spinner.min; SendMessage(h, WM_GETTEXT, 79, (LPARAM)ws); - wcstombs(s, ws, 79); + wcstombs(s, ws, 512); sscanf(s, "%i", &c); if (val_int != c) @@ -330,7 +330,8 @@ deviceconfig_dlgproc(HWND hdlg, UINT message, WPARAM wParam, LPARAM lParam) break; case CONFIG_SPINNER: - SendMessage(h, WM_GETTEXT, 79, (LPARAM)s); + SendMessage(h, WM_GETTEXT, 79, (LPARAM)ws); + wcstombs(s, ws, 512); sscanf(s, "%i", &c); if (c > config->spinner.max) c = config->spinner.max;