From 8743e9759e82bc07f19ee64fbb610d76da02f6d9 Mon Sep 17 00:00:00 2001 From: Ozkan Sezer Date: Wed, 26 Sep 2018 17:11:40 +0300 Subject: [PATCH] SDL_vsnprintf: when '.' is specified, take precision as 0 if it is < 0. --- src/stdlib/SDL_string.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/stdlib/SDL_string.c b/src/stdlib/SDL_string.c index 0ba6be74d..047b32039 100644 --- a/src/stdlib/SDL_string.c +++ b/src/stdlib/SDL_string.c @@ -1618,6 +1618,9 @@ SDL_vsnprintf(SDL_OUT_Z_CAP(maxlen) char *text, size_t maxlen, const char *fmt, } else { info.precision = 0; } + if (info.precision < 0) { + info.precision = 0; + } } while (!done) {