mirror of
https://github.com/sheumann/hush.git
synced 2024-12-21 23:29:34 +00:00
fix for suffix optimization (which was in previous commit)
This commit is contained in:
parent
f868963c67
commit
1bab1de698
@ -450,6 +450,7 @@ const char *make_human_readable_str(unsigned long long size,
|
|||||||
/* Put a string of hex bytes ("1b2e66fe"...), return advanced pointer */
|
/* Put a string of hex bytes ("1b2e66fe"...), return advanced pointer */
|
||||||
char *bin2hex(char *buf, const char *cp, int count);
|
char *bin2hex(char *buf, const char *cp, int count);
|
||||||
|
|
||||||
|
/* Last element is marked by mult == 0 */
|
||||||
struct suffix_mult {
|
struct suffix_mult {
|
||||||
char suffix[4];
|
char suffix[4];
|
||||||
unsigned mult;
|
unsigned mult;
|
||||||
|
@ -45,7 +45,7 @@ unsigned type xstrtou(_range_sfx)(const char *numstr, int base,
|
|||||||
* Note that we also allow nul suffixes with associated multipliers,
|
* Note that we also allow nul suffixes with associated multipliers,
|
||||||
* to allow for scaling of the numstr by some default multiplier. */
|
* to allow for scaling of the numstr by some default multiplier. */
|
||||||
if (suffixes) {
|
if (suffixes) {
|
||||||
while (suffixes->suffix) {
|
while (suffixes->mult) {
|
||||||
if (strcmp(suffixes->suffix, e) == 0) {
|
if (strcmp(suffixes->suffix, e) == 0) {
|
||||||
if (XSTR_UTYPE_MAX / suffixes->mult < r)
|
if (XSTR_UTYPE_MAX / suffixes->mult < r)
|
||||||
goto range; /* overflow! */
|
goto range; /* overflow! */
|
||||||
|
Loading…
Reference in New Issue
Block a user