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