#why doesn't this header file link?

14 messages · Page 1 of 1 (latest)

torpid mortarBOT
#

When your question is answered use !solved to mark the question as resolved.

Remember to ask specific questions, provide necessary details, and reduce your question to its simplest form. For tips on how to ask a good question use !howto ask.

spare schooner
#

hmmm could you show the definition of searchwithtext ? buffer overflow makes me think it's an issue with a function, it seems you're using the header correctly

#

oh cool!

#

yea that

#

hmmm, i think this is enough

#

the line

int length = (&text)[1] - text;

seems to be a bug, i don't know if it's the bug, but in this this case it seems you're taking the address of a char[], and then indexing the second element into that (which i assume you were trying to index past the string, and subtract that pointer from the text pointer)

#

but in this case, the size of char[] is always 8 because there's no given size in the type

#

try out int length = strlen(text); instead, if the string you're taking in is always null terminated

spare schooner
#

ah i see

#

wooooo yay

#

:D

#

nah, issa W for you

#

👍