Improve error message for mismatched formats.
That caught me many times.
@@ -180,6 +180,9 @@ const sbfmtv = {sb, fmt, ap -> size
match (state, (b : char))
/* raw bytes */
| (`Copy, '{'):
+ if nfmt > nvarargs
+ die("too few values for fmt\n")
+ ;;
if (fmt[i] : char) == '{'
b = fmt[i++]
sbputb(sb, ('{' : byte))
@@ -238,7 +241,7 @@ const sbfmtv = {sb, fmt, ap -> size
;;
;;
if nfmt != nvarargs
- die("too many params for fmt\n")
+ die("too many values for fmt\n")
;;
-> sb.len
}
