Skip to content

Fix printing of the empty binary - #2455

Merged
bettio merged 1 commit into
atomvm:release-0.7from
petermm:fix/empty-binary-print-2449
Nov 5, 2026
Merged

bettio merged 1 commit into
atomvm:release-0.7from
petermm:fix/empty-binary-print-2449

Conversation

@petermm

@petermm petermm commented Oct 30, 2026

Copy link
Copy Markdown
Contributor

The C term printer, used by erlang:display/1 and crash reports, and io_lib:format/2 with ~p both printed the empty binary as <<"">>, because an empty byte sequence counted as a printable string. OTP only uses the quoted form for non-empty printable binaries, and prints <<>>.

Fixes: #2449

These changes are made under both the "Apache 2.0" and the "GNU Lesser General
Public License 2.1 or later" license terms (dual license).

SPDX-License-Identifier: Apache-2.0 OR LGPL-2.1-or-later

Comment thread libs/estdlib/src/io_lib.erl Resolved
The C term printer, used by erlang:display/1 and crash reports, and
io_lib:format/2 with ~p both printed the empty binary as <<"">>,
because an empty byte sequence counted as a printable string. OTP
only uses the quoted form for non-empty printable binaries, and
prints <<>>.

Fixes: atomvm#2449
Signed-off-by: Peter Madsen-Mygdal <petermm@gmail.com>
@petermm
petermm force-pushed the fix/empty-binary-print-2449 branch from 61aded0 to 466d725 Compare October 31, 2026 08:20
@bettio
bettio merged commit 8f4f59b into atomvm:release-0.7 Nov 5, 2026
174 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants