01-18-2021, 08:59 PM
@ab1jx This is a coding problem, not a Pinebook Pro problem.
In the case you want help, you should post a small snippet of your code that demonstrates the problem. I highly doubt both gcc and clang have some problem, especially given all the programs running on your machine were compiled with one of those and all seem to work.
Regarding the search function strstr() [1]:
1. Sanity check that the example given in tutorialspoint works [1] - if it doesn't, you really have massive problems.
2. Does the haystack contain the full string? Try printing it... Perhaps you are not getting the result you think you are from the GET request.
3. Is there a NULL character `\0` early on in the string?
4. Remember that strstr() is going to return a pointer to the offset where the string was found - not the offset in the string, so you need to check it against NULL. If you try to do something like `haystack[strstr(haystack, needle)]` you will almost certainly segmentation fault.
[1] https://www.tutorialspoint.com/c_standar...strstr.htm
In the case you want help, you should post a small snippet of your code that demonstrates the problem. I highly doubt both gcc and clang have some problem, especially given all the programs running on your machine were compiled with one of those and all seem to work.
Regarding the search function strstr() [1]:
1. Sanity check that the example given in tutorialspoint works [1] - if it doesn't, you really have massive problems.
2. Does the haystack contain the full string? Try printing it... Perhaps you are not getting the result you think you are from the GET request.
3. Is there a NULL character `\0` early on in the string?
4. Remember that strstr() is going to return a pointer to the offset where the string was found - not the offset in the string, so you need to check it against NULL. If you try to do something like `haystack[strstr(haystack, needle)]` you will almost certainly segmentation fault.
[1] https://www.tutorialspoint.com/c_standar...strstr.htm