mirror of
https://github.com/ProgramSnail/Lama.git
synced 2025-12-05 22:38:44 +00:00
Fixed bug in potential reuse of args in vsnprintf
This commit is contained in:
parent
669a4288d7
commit
f953814c76
3 changed files with 12 additions and 6 deletions
|
|
@ -421,11 +421,17 @@ static void vprintStringBuf (char *fmt, va_list args) {
|
|||
int written = 0,
|
||||
rest = 0;
|
||||
char *buf = (char*) BOX(NULL);
|
||||
va_list vsnargs;
|
||||
|
||||
again:
|
||||
va_copy (vsnargs, args);
|
||||
|
||||
buf = &stringBuf.contents[stringBuf.ptr];
|
||||
rest = stringBuf.len - stringBuf.ptr;
|
||||
written = vsnprintf (buf, rest, fmt, args);
|
||||
|
||||
written = vsnprintf (buf, rest, fmt, vsnargs);
|
||||
|
||||
va_end(vsnargs);
|
||||
|
||||
if (written >= rest) {
|
||||
extendStringBuf ();
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
let version = "Version 1.10, eb098a6fa, Sun Oct 31 15:34:34 2021 +0300"
|
||||
let version = "Version 1.10, 669a4288d, Mon Nov 22 15:51:47 2021 +0300"
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ SHELL := /bin/bash
|
|||
|
||||
FILES=$(wildcard *.lama)
|
||||
ALL=$(sort $(FILES:.lama=.o))
|
||||
LAMAC=../src/lamac -ds
|
||||
LAMAC=../src/lamac -g
|
||||
|
||||
all: $(ALL)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue