Skip to content

Commit 27579eb

Browse files
no1wudianchao
authored andcommitted
examples/fb: Fix error message formatting and accuracy
Fix two error message issues in the framebuffer example: * Add missing newline character to fbmem2 error message in fb_init_mem2() * Correct mmap() error message that incorrectly referenced FBIOGET_PLANEINFO These changes improve error reporting clarity and consistency for debugging framebuffer initialization issues. Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
1 parent a44d65c commit 27579eb

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

examples/fb/fb_main.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ static int fb_init_mem2(FAR struct fb_state_s *state)
211211

212212
if (pinfo.bpp != state->pinfo.bpp)
213213
{
214-
fprintf(stderr, "ERROR: fbmem2 is incorrect");
214+
fprintf(stderr, "ERROR: fbmem2 is incorrect\n");
215215
return -EINVAL;
216216
}
217217

@@ -622,7 +622,7 @@ int main(int argc, FAR char *argv[])
622622
if (state.fbmem == MAP_FAILED)
623623
{
624624
int errcode = errno;
625-
fprintf(stderr, "ERROR: ioctl(FBIOGET_PLANEINFO) failed: %d\n",
625+
fprintf(stderr, "ERROR: mmap() failed: %d\n",
626626
errcode);
627627
close(state.fd);
628628
return EXIT_FAILURE;

0 commit comments

Comments
 (0)