Want to read Slashdot from your mobile device? Point it at m.slashdot.org and keep reading!

 



Forgot your password?
typodupeerror
×
User Journal

Journal ryanr's Journal: Bug Puzzle #4 6

OK, since you probably had to look at my stupid C questions, I might as well produce a bug puzzle.

What's wrong with this code snippet?

char *dest;
char src[] = "Hello";

dest = (char *)malloc (strlen(src));
strcpy (dest, src);

(This one should be relatively easy for most people, I think.)

This discussion has been archived. No new comments can be posted.

Bug Puzzle #4

Comments Filter:

The person who can smile when something goes wrong has thought of someone to blame it on.

Working...