mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-09-05 19:08:12 +00:00
Fixed warning C6263: Using _alloca in a loop: this can quickly overflow stack.
This commit is contained in:
@@ -1288,16 +1288,15 @@ WIN_WindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
|
||||
HDROP drop = (HDROP)wParam;
|
||||
UINT count = DragQueryFile(drop, 0xFFFFFFFF, NULL, 0);
|
||||
for (i = 0; i < count; ++i) {
|
||||
SDL_bool isstack;
|
||||
UINT size = DragQueryFile(drop, i, NULL, 0) + 1;
|
||||
LPTSTR buffer = SDL_small_alloc(TCHAR, size, &isstack);
|
||||
LPTSTR buffer = (LPTSTR)SDL_malloc(sizeof(TCHAR) * size);
|
||||
if (buffer) {
|
||||
if (DragQueryFile(drop, i, buffer, size)) {
|
||||
char *file = WIN_StringToUTF8(buffer);
|
||||
SDL_SendDropFile(data->window, NULL, file);
|
||||
SDL_free(file);
|
||||
}
|
||||
SDL_small_free(buffer, isstack);
|
||||
SDL_free(buffer);
|
||||
}
|
||||
}
|
||||
SDL_SendDropComplete(data->window);
|
||||
|
Reference in New Issue
Block a user