News for hackers. Stuff that matters.
Re:Old C code – how to upgrade it? by hereforonep on Friday April 08, 2022 @02:47PM (#30961015)
Char does imply string but byte in C
Re:Old C code – how to upgrade it? by saghm on Friday April 08, 2022 @05:30PM (#30962737)
It looks like the `*` that I copied got interpreted as markdown by HN's parser, and unfortunately it's too late for me to edit it. The code snippet I copied should show a cast to `char *. I suppose it's possible that OP's code could actually just be using it as a pointer to a single byte, but it seems fairly reasonable to assume that the value is a C string (i.e. pointer to a set of bytes with a null terminator) given that this is a Forth implementation (i.e. a stack based language) and the value that's being assigned looks like it's being popped off a stack.