preproc.c: make extra sure we always have a null-terminated token
commit4ed23c8f8557db0ed8578a090a0c483cd993c076
authorH. Peter Anvin (Intel) <hpa@zytor.com>
Mon, 15 Jun 2020 02:55:49 +0000 (14 19:55 -0700)
committerH. Peter Anvin (Intel) <hpa@zytor.com>
Mon, 15 Jun 2020 02:55:49 +0000 (14 19:55 -0700)
tree7a37edd999db8c4bd64374d3a81123bb0df10372
parent00335e43ef59194152aa0e81e253e7ccdba29ff2
preproc.c: make extra sure we always have a null-terminated token

tok_set_text() and tok_set_text_free() take a length argument, which
could at least theoretically mean that we don't have a null-terminated
string. Directly enforce a null-terminated string in all cases.

In the future this means that it is legal to intentionally use these
functions to tokenize a substring.

Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
asm/preproc.c