SDL_ttf: Fixed bug #157 - Behavior of "Wrapped" with small lengths

From 5d387eb60905c533aae6d97478cfad107c261329 Mon Sep 17 00:00:00 2001
From: Sylvain <[EMAIL REDACTED]>
Date: Fri, 7 Jan 2022 08:28:20 +0100
Subject: [PATCH] Fixed bug #157 - Behavior of "Wrapped" with small lengths

---
 SDL_ttf.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/SDL_ttf.c b/SDL_ttf.c
index 47a065a..5d865a7 100644
--- a/SDL_ttf.c
+++ b/SDL_ttf.c
@@ -3410,6 +3410,10 @@ static SDL_Surface* TTF_Render_Wrapped_Internal(TTF_Font *font, const char *text
                 goto failure;
             }
 
+            if (max_count == 0) {
+                max_count = 1;
+            }
+
             while (textlen > 0) {
                 int inc = 0;
                 int is_delim;