Null-terminated string
No Null-terminating string support?
Any problems with null-terminated strings? chars field should work
Hmmm, I thought it was not supported, how would be the syntax on that?
For example I have a null terminated string on a buffer, or a string that is fixed on an actual length no null terminators? How would both work?
see source - it uses standard NodeJS Buffer.toString Method and slices string to zero character.
https://github.com/xdenser/node-struct/blob/master/index.js#L92
So it uses null to terminate the string but if it won't find the null terminator it will use the full length?
wrong: p.buf.fill(0, (offset + val.length), length);
correct: p.buf.fill(0, (offset + val.length), (offset + length) );