Files
freebsd/lib
Xin LI 08300d8494 expand_number: Tighten check of unit.
The current code silently ignores characters after the unit as long
the unit themselves were recognized. This commit makes expand_number(3)
to fail with EINVAL if buf did not terminate after the unit character.

Historically, the function accepts and ignores "B" as a SI unit, this
behavior is preserved and e.g. KB, MB are still accepted as aliases of
K and M, document this behavior in the manual page.

While I am there, also write a few test cases to validate the behavior.

Reviewed-by:	emaste
MFC-after:	2 weeks
Differential Revision: https://reviews.freebsd.org/D40482
2023-06-12 21:08:32 -07:00
..
2023-06-01 20:43:04 -06:00
2023-06-09 20:49:51 -07:00
2023-04-21 16:10:03 -04:00
2023-04-14 16:56:30 -07:00
2023-04-03 22:48:48 +03:00
2023-02-08 10:33:26 -07:00
2023-05-12 15:49:34 -07:00
2023-03-16 19:02:56 +00:00
2023-03-09 18:04:21 +00:00
2023-04-20 10:05:43 -07:00
…