-
Notifications
You must be signed in to change notification settings - Fork 20
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
Problem with cinput #65
Comments
I did a quick test with llvm-mos and the problem seem to exist there as well. If
|
Pushed ab8d787 that modifies documentation. |
I vote for the first choice because inside the c_input function there is this code that put '\0' in the buffer.
|
OK, how about placing the range check just before calling |
Do you mean like something that?
Ok for me. |
Yes, exactly. Would you mind making a pull request? |
OK. Done. |
I’m using the libc65 library with Calypsis. A very simple program that requires input from the user.
The program freezes and monitor is starting.
I investigated and solved the problem by adding this control
if (len ==0) return;
I hypothesize that the lcopy function messes up when the string length is zero, at least with the Calypsis compiler. I don't know with others.
If the length is greater than zero there is no problem.
The problem is that at MEGA65 hardware level at least, len=0 means 64Kbyte. This explains the problem.
![Screenshot 2024-09-08 alle 20 33 28](https://private-user-images.githubusercontent.com/28490169/365806481-b86bf7b3-b57a-45ae-9e0a-a0ecfe36bb0f.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzg5ODMzNDcsIm5iZiI6MTczODk4MzA0NywicGF0aCI6Ii8yODQ5MDE2OS8zNjU4MDY0ODEtYjg2YmY3YjMtYjU3YS00NWFlLTllMGEtYTBlY2ZlMzZiYjBmLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMDglMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjA4VDAyNTA0N1omWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTgxMmMxY2JlM2Q2Mzg3NGQzODUzMDIxZmJlZWY1Zjc4MDdlODM2NzU5Zjk0MmU4MTZiYzc4NGUxY2U4MDJjNjkmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.4cRFlYp-2MDkxr8zB-IpJy1tsfoMUWZasejVPLzbWOU)
The text was updated successfully, but these errors were encountered: