return true if str of size len contains an embedded null
| 201 | |
| 202 | // return true if str of size len contains an embedded null |
| 203 | inline bool embedded_null(const char *str, size_t len) |
| 204 | { |
| 205 | while (len--) |
| 206 | if (!*str++) |
| 207 | return true; |
| 208 | return false; |
| 209 | } |
| 210 | |
| 211 | // return the length of a string, omitting trailing nulls |
| 212 | inline size_t len_without_trailing_nulls(const char *str, size_t len) |