shameless self-promoting website
»Rejourn root
Posted Thursday, 17 November 2005 by Miklos
Tags: en hacking

during coding the setup, i noticed some strange behaviours, i debugged then for a long time ;)

so to learn from my faults:

  • strcat does not accepts a NULL pointer as a dest char*
  • getenv() just gives you a pointer, you have to strdup() it if you want to modify the value

an other thing: i forgot again and again what's the difference between

in gdb:
  • setp executes the current line of the program and stops on the next statement to be executed
  • next is like step, however, if the current line of the program contains a function call, it executes the function and stops at the next line

ah, and if you want to execute the whole code line by line from the begining, you'll need

break 1
and then the usual