simonkrauter / NiGui

Cross-platform desktop GUI toolkit written in Nim
MIT License
724 stars 49 forks source link

Index out of bounds #35

Closed ChillaChris closed 5 years ago

ChillaChris commented 5 years ago

Since the update to 0.1.1(and/or the latest update(s) to nim) SaveFileDialog is broken. When the button is clicked that generates/calls the dialog the app returns the following when using the example: Unhandled Exception

index out of bounds

Traceback (most recent call last) example_12_file_dialogs.nim(44) example_12_file_dialogs nigui.nim(973) run nigui.nim(951) handleException nigui.nim(946) raiseError

simonkrauter commented 5 years ago

Is this under Windows or Linux? Can you please give the output of nim --version?

ChillaChris commented 5 years ago

Windows 10 64-bit. nim --version: Nim Compiler Version 0.19.2[Windows: i386] Compiled at 2018-12-31 Copyright (c) 2006-2018 by Andreas Rumpf

git hash: 7beea1642ddf7845a9a0034c7a93ccbe15894c36 active boot switches: -d:release

simonkrauter commented 5 years ago

The for loop, which copied the characters, wanted to access the null terminator, which is not allowed any more. I replaced the loop with copyMem().