if you maybe can explain it a little for me
The fundamental difference is that I set the last element of the array with index idx to zero to get a proper zero terminated char array. That is the way C likes it.
You set the index to 0 and then set the first element of the array to zero. This causes problems in the strtok() code as it sees in essence an empty string ...(
Give it a try ...