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

protect against decimals in menu/tape.lua #1804

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

dndrks
Copy link
Member

@dndrks dndrks commented Nov 20, 2024

from https://llllllll.co/t/tape-isnt-recording/64461/10

re:

for f in tape:gmatch("([^\n]+)") do
fs = string.sub(f,1,4)
if tonumber(fs) then
table.insert(t,tonumber(fs))
end
end

if a file in audio/tape is named something like 10.20.24.wav, then it'll be string.sub'd as index 10.2 which passes the tonumber check and gets assumed as m.fileindex. but, later on, this string.format fails, since 10.2 doesn't have an integer representation and then the entire TAPE record process fails to initiate.

a more robust fix would add tapeindex to the norns.state table for iteration, removing the need for this checking, but this modulo check seems like the least invasive option. happy to spin up in the other direction, though!

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

Successfully merging this pull request may close these issues.

1 participant