Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
idx
is not initialized, meaning its value when the function is entered is arbitrary, and will sometimes cause out-of-bounds accesses, depending on what's on the stack at this point in timeyour allocation of
5
bytes forcStr
is also rather optimistic, what if your function is called with"0123456.789.10.11
? (i dont know if such inputs are tested since the kata is underspecified, but in C you should always be careful)So try reinitializing this pointer on each function call, or something like that (sorry if this is not correct or not correctly worded, but as I said I didn't scrutinize your code and don't know what it is doing).
You can do the trial yourself: in the test window (at the bottom page): your code passes all tests taken one by one; by it crashes as soon as there are two or more consecutive tests.
What's weird is when one runs your code test after test, here too it works fine. But when running several tests on a row then the code crashes. I didn't examine your code in detail. Don't you have something like a global variable somewhere?
Have you tried printing the input?
Not an issue. Your solution is wrong.