Bugzilla – Attachment 3141 Details for
Bug 2769
String truncation warnings in fmt_scaled
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
with 100% less assert(3)
bz2769.diff (text/plain), 575 bytes, created by
Damien Miller
on 2018-04-13 13:54:46 AEST
(
hide
)
Description:
with 100% less assert(3)
Filename:
MIME Type:
Creator:
Damien Miller
Created:
2018-04-13 13:54:46 AEST
Size:
575 bytes
patch
obsolete
>diff --git a/openbsd-compat/fmt_scaled.c b/openbsd-compat/fmt_scaled.c >index f68f2412..d503fd73 100644 >--- a/openbsd-compat/fmt_scaled.c >+++ b/openbsd-compat/fmt_scaled.c >@@ -246,13 +246,14 @@ fmt_scaled(long long number, char *result) > > fract = (10 * fract + 512) / 1024; > /* if the result would be >= 10, round main number */ >- if (fract == 10) { >+ if (fract >= 10) { > if (number >= 0) > number++; > else > number--; > fract = 0; >- } >+ } else if (fract < 0) >+ fract = 0; /* shouldn't happen */ > > if (number == 0) > strlcpy(result, "0B", FMT_SCALED_STRSIZE);
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Flags:
dtucker
:
ok+
Actions:
View
|
Diff
Attachments on
bug 2769
:
3042
| 3141