diff options
| author | Mike Pall <mike> | 2025-10-16 13:13:51 +0200 |
|---|---|---|
| committer | Mike Pall <mike> | 2025-10-16 13:13:51 +0200 |
| commit | a69aef43fe1838da26c193d188580229b2387583 (patch) | |
| tree | 1f4f6f316461f55655b559121e78a366eaaefbaf /src | |
| parent | 54a162688ed25902122077149df9b456bc5a763e (diff) | |
| download | luajit-a69aef43fe1838da26c193d188580229b2387583.tar.gz luajit-a69aef43fe1838da26c193d188580229b2387583.tar.bz2 luajit-a69aef43fe1838da26c193d188580229b2387583.zip | |
Fix io.write() of newly created buffer.
Reported by vfprintf. #1386
Diffstat (limited to 'src')
| -rw-r--r-- | src/lj_strfmt.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/lj_strfmt.c b/src/lj_strfmt.c index 04aebaa4..bb649fc8 100644 --- a/src/lj_strfmt.c +++ b/src/lj_strfmt.c | |||
| @@ -170,7 +170,7 @@ const char *lj_strfmt_wstrnum(lua_State *L, cTValue *o, MSize *lenp) | |||
| 170 | } else if (tvisbuf(o)) { | 170 | } else if (tvisbuf(o)) { |
| 171 | SBufExt *sbx = bufV(o); | 171 | SBufExt *sbx = bufV(o); |
| 172 | *lenp = sbufxlen(sbx); | 172 | *lenp = sbufxlen(sbx); |
| 173 | return sbx->r; | 173 | return sbx->r ? sbx->r : ""; |
| 174 | } else if (tvisint(o)) { | 174 | } else if (tvisint(o)) { |
| 175 | sb = lj_strfmt_putint(lj_buf_tmp_(L), intV(o)); | 175 | sb = lj_strfmt_putint(lj_buf_tmp_(L), intV(o)); |
| 176 | } else if (tvisnum(o)) { | 176 | } else if (tvisnum(o)) { |
