From a35cd511fab8401747ad9082a8569ffff120f09f Mon Sep 17 00:00:00 2001 From: Matt Clarkson Date: Fri, 22 May 2015 14:03:41 +0100 Subject: [PATCH] Correct argument for GetDlgItem GetDlgItem takes an integer as the identifier of the contol to be retrieved. buflen is an unsigned integer. Assuming this code works this just makes the truncation cast explicit. No functionality changes but buflen *could* be over the limit of an integer. Very unlikey that there will be a string that is 2^31 long though. --- src/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main.c b/src/main.c index e8109f4a..d636b2fe 100644 --- a/src/main.c +++ b/src/main.c @@ -1095,7 +1095,7 @@ static BOOL CALLBACK InputDlgProc(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lP) if (ctrlId == IDOK) { /* Add user */ GetWindowText( - GetDlgItem(hDlg, ID_INPUT_LINE), inBuf->buffer, inBuf->buflen); + GetDlgItem(hDlg, ID_INPUT_LINE), inBuf->buffer, (int)inBuf->buflen); if (strlen(inBuf->buffer) > 0) { EndDialog(hDlg, IDOK); }