On Feb 1, 8:44 pm, sanju <[email protected]> wrote: > -0x10... if you guys find any problem with code please let me know, > any suggestions and pointer are welcome ...
De-obfuscating it with a focus on varfunc() yields: str is a 30-byte buffer allocated on the heap str1 is a 30-byte buffer allocated on the stack temp = str; strMan(temp, str1); calls "strcpy(temp, str)", which actually does "strcpy(str1, temp)", because you've reversed the order of the names in the arguments to strMan(). So you're copying the static string passed in by main() into str1, which gets cleared on each pass through the loop, yielding: inside var func inside loop for before string manipulation after string manipulation Sanjeeth after loop Sanjeeth inside loop for before string manipulation after string manipulation Ganapathy after loop Ganapathy inside loop for before string manipulation after string manipulation Sanju after loop Sanju inside loop for before string manipulation At this point it crashes, because you're assuming that the last argument is NULL, but you didn't pass a NULL pointer into varfunc(). As far as I can tell it's doing exactly what it should be. I don't see anything being offset, and it crashes on schedule. -- unsubscribe: [email protected] website: http://groups.google.com/group/android-porting
