#13925 closed bug (fixed)

libroot: Fix possible typo in printf_size.c

Reported by: ohnx56 Owned by: nobody
Priority: normal Milestone: Unscheduled
Component: System/libroot.so Version: R1/Development
Keywords: Cc:
Blocked By: Blocking:
Has a Patch: yes Platform: All

Description

It appears as if there is a typo in printf_size.c; it makes no sense to compare an unitialized variable in such a way. Since info->width is referenced later on in the variable assignment, it seems possible that the intended statement was to place the larger of the values between info->width and info->prec into width.

Fixes CID 609431.

Attachments (1)

0001-libroot-Fix-possible-typo-in-printf_size.c.patch (1.3 KB) - added by ohnx56 16 months ago.

Download all attachments as: .zip

Change History (6)

comment:1 Changed 16 months ago by ohnx56

Has a Patch: set

comment:2 Changed 16 months ago by korli

Indeed the original patch is here: https://github.com/bminor/glibc/commit/fa5753eede3e97e94f50928989b313fb1fbdae6f.patch

Is it OK if I apply this instead of your patch?

comment:3 Changed 16 months ago by ohnx56

Ah! Didn't know about that :p

Of course.

comment:4 Changed 16 months ago by ohnx56

Actually, it seems the Haiku version is different from the glibc patch's version; someone must have already fixed the second width.

Not sure if that affects the patch though.

comment:5 Changed 16 months ago by korli

Resolution: fixed
Status: newclosed

Applied in hrev51726, thanks!

Note: See TracTickets for help on using tickets.