From 877b4b9889a3ba5e935373580fefaf9d747001ec Mon Sep 17 00:00:00 2001 From: johannst Date: Sun, 14 Mar 2021 21:08:25 +0100 Subject: pfmt: added upper limit for stack local buffer --- include/io.h | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'include') diff --git a/include/io.h b/include/io.h index d9a1ae1..4f61cbf 100644 --- a/include/io.h +++ b/include/io.h @@ -8,15 +8,17 @@ #include // `pfmt` uses fixed-size buffer on the stack for formating the message -// (since we don't impl buffered I/O). +// (for simplicity and since we don't impl buffered I/O). // // Size can be re-configured by defining `MAX_PRINTF_LEN` before including // `io.h`. // -// NOTE: This allows to specify an arbitrarily large buffer on the stack, but -// for the purpose of this study that's fine, we are cautious. +// NOTE: This allows to specify a large buffer on the stack, but for +// the purpose of this study that's fine, we are cautious. #if !defined(MAX_PRINTF_LEN) # define MAX_PRINTF_LEN 128 +#elif MAX_PRINTF_LEN > 512 +# error MAX_PRINTF_LEN is limited by 512! #endif #define FD_STDOUT 1 -- cgit v1.2.3