Fixed bug in 'string.format("%p")'

The string "(null)" used for non-collectable values must be printed as a
string, not as a pointer. (Bug introduced in commit e0cbaa50fa).
This commit is contained in:
Roberto Ierusalimschy
2020-03-16 14:13:13 -03:00
parent e460752323
commit 513559cc47
3 changed files with 19 additions and 8 deletions

View File

@@ -131,8 +131,7 @@ static void warnf (void *ud, const char *msg, int tocont) {
if (buff[0] != '#' && onoff) /* unexpected warning? */
badexit("Unexpected warning in test mode: %s\naborting...\n",
buff, NULL);
/* else */ /* FALLTHROUGH */
}
} /* FALLTHROUGH */
case 1: { /* allow */
if (onoff)
fprintf(stderr, "Lua warning: %s\n", buff); /* print warning */