mirror of
https://github.com/janet-lang/janet
synced 2025-06-28 08:03:00 +00:00
Merge pull request #1106 from CosmicToast/1105
handle null-byte case in scanformat (fixes #1105)
This commit is contained in:
commit
d9ed7a77f8
@ -809,7 +809,8 @@ static const char *scanformat(
|
|||||||
*(form++) = '%';
|
*(form++) = '%';
|
||||||
const char *p2 = strfrmt;
|
const char *p2 = strfrmt;
|
||||||
while (p2 <= p) {
|
while (p2 <= p) {
|
||||||
if (strchr(FMT_REPLACE_INTTYPES, *p2) != NULL) {
|
char *loc = strchr(FMT_REPLACE_INTTYPES, *p2);
|
||||||
|
if (loc != NULL && *loc != '\0') {
|
||||||
const char *mapping = get_fmt_mapping(*p2++);
|
const char *mapping = get_fmt_mapping(*p2++);
|
||||||
size_t len = strlen(mapping);
|
size_t len = strlen(mapping);
|
||||||
strcpy(form, mapping);
|
strcpy(form, mapping);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user