Name: Anonymous 2010-08-12 14:42
A snippet in my code goes something like
puts(string1);
strcpy(string2, string1);
puts(string1);
but that 2nd call of puts results in a segfault. I thought strcpy only copies. wtf is going on? I couldn't recreate it though on its own so I think it must be this project.
If you guys have nothing to do, maybe you can have a look.
http://pastebin.ca/1915922
It's part of a larger project but this one here reads two lines of text from a given file and separates the tokens that are separated by commas and spaces.
puts(string1);
strcpy(string2, string1);
puts(string1);
but that 2nd call of puts results in a segfault. I thought strcpy only copies. wtf is going on? I couldn't recreate it though on its own so I think it must be this project.
If you guys have nothing to do, maybe you can have a look.
http://pastebin.ca/1915922
It's part of a larger project but this one here reads two lines of text from a given file and separates the tokens that are separated by commas and spaces.