fixed a segfault bug in index()/rindex() function handler which treated a byte character as a byte string.

enhanced code to handle BOB better
This commit is contained in:
2025-07-10 23:12:47 +09:00
parent 45a22eb5a4
commit 955210800e
13 changed files with 296 additions and 32 deletions

View File

@ -1059,6 +1059,8 @@ static int fmt_outv (hawk_fmtout_t* fmtout, va_list ap)
}
case 'O': /* object - ignore precision, width, adjustment */
/* NOTE: currently, there is no hawk_fmtout_t value that fills the putobj field. */
/* it's kind of reserved for future implementation */
if (!fmtout->putobj) goto invalid_format;
if (fmtout->putobj(fmtout, va_arg(ap, hawk_val_t*)) <= -1) goto oops;
break;