Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

zstring.Format with 4+ count args will cause IndexOutOfRangeException #117

Open
jarekzha opened this issue Dec 13, 2024 · 0 comments
Open

Comments

@jarekzha
Copy link

code below will cause IndexOutOfRangeException

            string text;
            using (zstring.Block())
            {
                var sign = "";
                text = zstring.Format("hello:{0}:{1}:{2}:{3}",123, "abc", sign, 3);
            }
            return text;
IndexOutOfRangeException: Index was outside the bounds of the array.
zstring.internal_format (System.String input, System.Int32 num_args) (at zstring.cs:369)
zstring.Format (System.String input, zstring arg0, zstring arg1, zstring arg2, zstring arg3) (at zstring.cs:1508)

if args count is less than 4, code will success.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant