3 ms·
Yes, lots of APIs that take char * will break if you pass them some arbitrary other type of data that you assume they will handle.
by ambrice 13y ago
Yes, lots of APIs that take char * will break if you pass them some arbitrary other type of data that you assume they will handle.
- simonh 13y agoHow about if they are implementing a public standard that states this other arbitrary type of data is valid?
- ambrice 13y agoIt is a logical leap to assume that because the spec says other types of data are valid that means you should be able to pass arbitrary data to this function that is documented as requiring a 0 terminated string. Let's say you wanted to pass an IPv4 address. Would you expect to pass it a uint32_t pointer? A struct in_addr pointer? Host or network byte order?
- deleted 13y ago[deleted]