aboutsummaryrefslogtreecommitdiff
path: root/lstrlib.c
diff options
context:
space:
mode:
Diffstat (limited to 'lstrlib.c')
-rw-r--r--lstrlib.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/lstrlib.c b/lstrlib.c
index 586e0d78..e47a1d8d 100644
--- a/lstrlib.c
+++ b/lstrlib.c
@@ -1271,6 +1271,8 @@ static int str_format (lua_State *L) {
1271 } 1271 }
1272 case 'p': { 1272 case 'p': {
1273 const void *p = lua_topointer(L, arg); 1273 const void *p = lua_topointer(L, arg);
1274 if (p == NULL)
1275 p = "(null)"; /* NULL not a valid parameter in ISO C 'printf' */
1274 nb = l_sprintf(buff, maxitem, form, p); 1276 nb = l_sprintf(buff, maxitem, form, p);
1275 break; 1277 break;
1276 } 1278 }