(bs []byte)
| 7 | ) |
| 8 | |
| 9 | func nullTerminate(bs []byte) []byte { |
| 10 | // This emulates the direction in the spec to append a null |
| 11 | // byte to turn a string into a null-terminated one. |
| 12 | for i, b := range bs { |
| 13 | if b == '\x00' { |
| 14 | return bs[:i] |
| 15 | } |
| 16 | } |
| 17 | |
| 18 | return bs |
| 19 | } |
| 20 | |
| 21 | func decodeNullPaddedASCIIString(bs []byte) string { |
| 22 | // First, null-terminate if necessary. |
no outgoing calls
no test coverage detected