Welcome to the Builder Academy

Question find_all_dots - Valgrind issue

More
21 Apr 2017 20:38 #6646 by thomas
Also worth mentioning that the reason we have not seen massive failures with this is proably due to 4 being equal to sizeOf(int) on 32 bit systems.

Please Log in or Create an account to join the conversation.

More
24 Apr 2017 12:48 #6653 by cunning
Hi Thomas,
Correct, I do not see errors a lot on this call. But Valgrind does consistently call it out as overlap. I think your assessment is correct about 64 bit vs 32 bit.

Please Log in or Create an account to join the conversation.

More
24 Apr 2017 12:51 #6654 by cunning

thomas wrote: @cunning - you write that you "played around with memmove". What did you do, exactly?

This should work:

Code:
memmove(arg, arg+4, strlen(arg));



I did not use memmove on this function. I used it in get_number() i consistently had issues with that function. Though your reference here might be worth testing for me.

in get_number() i replaced the strcpy() with memmove.

memmove(*name, ppos, strlen(ppos) +1);
// strcpy(*name, ppos);

Please Log in or Create an account to join the conversation.

More
06 May 2017 23:20 #6709 by cunning
I did use memmove after your suggestion. I should have used it from the very beginning. It does work, and it resolves the overlap.

Please Log in or Create an account to join the conversation.

Time to create page: 0.193 seconds