Closed elnur0000 closed 4 years ago
Are you sure the string you're reading is over 1,000,000 characters? To be honest, my implementation of this was pretty poor and arbitrary. If you're sure the string you're reading could exceed 1 million characters, simply edit this line and recompile the library.
In the future, an optional parameter should be implemented to pass the maximum character limit over.
sry I asked the question poorly no it's not over 1 million characters, but I am trying to read only 5 out of it so instead of waiting for null-terminator, which doesn't exist for some reason, I was trying to find a way to set the max character count
There is probably various ways to terminate a string. I have only implemented one way which is why it may not be able to find that string. Do you know anything about what type of string it is?
As for your original question, there is currently no way to read the string then if it has no null terminator. You could implement a string reader function yourself where you read char by char manually until you satisfy some property that determines when the string terminates? That is all this library is doing after all when attempting to read a string.
I think it's a c++ string, which probably doesn't store null terminator in memory? thanks for the answer Rob, It's all clear now
Hi, is there any way to set a maximum character count when reading strings? or maybe there is a workaround for this issue?