strstr valgrind error
问题 I need some help with char* initialization and strstr in C. This is the general issue: I have a function func1 func1() func2(); The issue is that valgrind gives an error basically saying that strstr might be using an uninitialized value. To rectify this, I'd have to do something like char* str = "hello world"; , but then I can't realloc , which is an issue. I have tested my program with random strings and the issue is the fact that valgrind is treating str as uninitialized, but I just don't