Commit c17cfbf4 authored by Dino Bollinger's avatar Dino Bollinger Committed by Richard Gobeille
Browse files

Engine: Fix edge case where OSD_Printf() may wrongly remove the last char in a string

parent b2e15923
...@@ -1686,11 +1686,9 @@ int OSD_Printf(const char *f, ...) ...@@ -1686,11 +1686,9 @@ int OSD_Printf(const char *f, ...)
va_list va; va_list va;
buf = (char *)Xrealloc(buf, (size <<= 1)); buf = (char *)Xrealloc(buf, (size <<= 1));
va_start(va, f); va_start(va, f);
len = Bvsnprintf(buf, size-1, f, va); len = Bvsnprintf(buf, size, f, va);
va_end(va); va_end(va);
} while ((unsigned)len > size-1); } while ((unsigned)len >= size);
buf[len] = 0;
OSD_Puts(buf); OSD_Puts(buf);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment