Skip to content

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

Open
@jarekzha

Description

@jarekzha

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions