Can you copy a structure via pointer dereference in (Objective) C? -
according crashlytics, line causing trouble:
// copy preamble data _preamble = * (showmetahdrpreamble *) [data bytes]; _preamble showmetahdrpreamble struct. data not nil. suppose it's possible data may not long enough fill showmetahdrpreamble - looks condition isn't tested for.
but question syntax, not i've seen in c or objective c copying structs. i'd either copy using memcpy() or casting , copying individual structure members. valid way format data byte stream , copy structure?
any ideas on why line cause crash, or did answer that?
(i'm pretty sure on in c couldn't copy structures using '=', see ansi c k&r legal these days.)
Comments
Post a Comment