Convert a null-terminated bytes object to a string.
(s, encoding, errors)
| 166 | return s[:length] + (length - len(s)) * NUL |
| 167 | |
| 168 | def nts(s, encoding, errors): |
| 169 | """Convert a null-terminated bytes object to a string. |
| 170 | """ |
| 171 | p = s.find(b"\0") |
| 172 | if p != -1: |
| 173 | s = s[:p] |
| 174 | return s.decode(encoding, errors) |
| 175 | |
| 176 | def nti(s): |
| 177 | """Convert a number field to a python number. |
no test coverage detected