Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

strcpy causing segfaults from source

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.

Name: Anonymous 2010-08-13 12:38

>>40
I said learn to use a debugger. I know how to use one very well, which is why I never have to.

Name: Anonymous 2010-08-13 13:05

>>40
<insert Djikstra quote about programming being about putting bugs into programs here>

Name: Anonymous 2010-12-25 8:16

Name: Anonymous 2011-02-03 3:08

Name: Anonymous 2013-09-01 14:10


Assuming the axiom of choice and, given an infinite cardinal π and a non-zero cardinal μ, there exists a cardinal κ such that μ · κ = π if and only if μ ≤ π. It will be unique (and equal to π) if and only if μ < π.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List