SDL: correct termination of windows openfiledialog filters

From b7dac5072bb35b583fbc430282a66c526555c05f Mon Sep 17 00:00:00 2001
From: lunasorcery <[EMAIL REDACTED]>
Date: Wed, 25 Dec 2024 16:31:30 +0000
Subject: [PATCH] correct termination of windows openfiledialog filters

---
 src/dialog/SDL_dialog_utils.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/dialog/SDL_dialog_utils.c b/src/dialog/SDL_dialog_utils.c
index 38be4a1174f38..9d7acbe5da251 100644
--- a/src/dialog/SDL_dialog_utils.c
+++ b/src/dialog/SDL_dialog_utils.c
@@ -59,7 +59,7 @@ char *convert_filters(const SDL_DialogFileFilter *filters, int nfilters,
             return NULL;
         }
 
-        terminator = f[1].name ? separator : suffix;
+        terminator = ((i + 1) < nfilters) ? separator : suffix;
         new_length = SDL_strlen(combined) + SDL_strlen(converted)
                    + SDL_strlen(terminator) + 1;