From 11464343a912ba7cb0f4bf7f7dabd1c67255507c Mon Sep 17 00:00:00 2001 From: vitaut Date: Tue, 5 May 2015 10:00:11 -0700 Subject: [PATCH] Fix handling of exactly MAX_PACKED_ARGS arguments --- format.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/format.h b/format.h index cd8836f8..9e688675 100644 --- a/format.h +++ b/format.h @@ -1473,7 +1473,8 @@ inline void do_set_types(Arg *args, const T &arg, const Args & ... tail) { template inline void set_types(Arg *array, const Args & ... args) { - do_set_types(array, args...); + if (check(sizeof...(Args) > ArgList::MAX_PACKED_ARGS)) + do_set_types(array, args...); array[sizeof...(Args)].type = Arg::NONE; } @@ -1497,7 +1498,7 @@ inline void store_args(Arg *args, const T &arg, const Args & ... tail) { template ArgList make_arg_list(typename ArgArray::Type array, const Args & ... args) { - if (check(sizeof...(Args) > ArgList::MAX_PACKED_ARGS)) + if (check(sizeof...(Args) >= ArgList::MAX_PACKED_ARGS)) set_types(array, args...); store_args(array, args...); return ArgList(make_type(args...), array);