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 first time, it's a KLUDGE! The second, a trick. Later, it's a well-established technique! -- Mike Broido, Intermetrics

Working...