`malloc(sizeof("foo"))` isn't doing what you think it's doing. (That shouldn't be causing the segfault though)
FYI I think the reason you got a segfault when you assigned it to a string literal is that it's not writable memory
-
-
(Assuming something in that call tries to mutate it)
-
Yes, I think that's it. Makes sense in hindsight. Frustrating that's not more clear, at least mentioned in the docs.
- 4 more replies
New conversation -
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.