Commit a85cf62c1239081403bb6944b7c07b5aa560e005

Sylvain 2023-03-21T12:24:45

Fix sdltest_randomAsciiStringWithMaximumLength() where it requests a string a size 0 seen with: ./testautomation --seed MILAFAP2AKVP3V4G --filter sdltest_randomAsciiStringWithMaximumLength

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
diff --git a/src/test/SDL_test_fuzzer.c b/src/test/SDL_test_fuzzer.c
index b59cbb3..9e2e757 100644
--- a/src/test/SDL_test_fuzzer.c
+++ b/src/test/SDL_test_fuzzer.c
@@ -471,7 +471,9 @@ char *SDLTest_RandomAsciiStringWithMaximumLength(int maxLength)
     }
 
     size = (SDLTest_RandomUint32() % (maxLength + 1));
-
+    if (size == 0) {
+        size = 1;
+    }
     return SDLTest_RandomAsciiStringOfSize(size);
 }