diff options
-rw-r--r-- | miscutils/bc.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/miscutils/bc.c b/miscutils/bc.c index 58734cf9c..1fb1b00b3 100644 --- a/miscutils/bc.c +++ b/miscutils/bc.c | |||
@@ -4798,8 +4798,6 @@ static BC_STATUS zbc_parse_expr(BcParse *p, uint8_t flags, BcParseNext next) | |||
4798 | 4798 | ||
4799 | #if ENABLE_DC | 4799 | #if ENABLE_DC |
4800 | 4800 | ||
4801 | #define DC_PARSE_BUF_LEN ((int) (sizeof(uint32_t) * CHAR_BIT)) | ||
4802 | |||
4803 | static BC_STATUS zdc_parse_register(BcParse *p) | 4801 | static BC_STATUS zdc_parse_register(BcParse *p) |
4804 | { | 4802 | { |
4805 | BcStatus s; | 4803 | BcStatus s; |
@@ -4816,11 +4814,11 @@ static BC_STATUS zdc_parse_register(BcParse *p) | |||
4816 | 4814 | ||
4817 | static BC_STATUS zdc_parse_string(BcParse *p) | 4815 | static BC_STATUS zdc_parse_string(BcParse *p) |
4818 | { | 4816 | { |
4819 | char *str, *name, b[DC_PARSE_BUF_LEN + 1]; | 4817 | char *str, *name; |
4820 | size_t idx, len = G.prog.strs.len; | 4818 | size_t idx, len = G.prog.strs.len; |
4821 | 4819 | ||
4822 | sprintf(b, "%0*zu", DC_PARSE_BUF_LEN, len); | 4820 | //why pad to 32 zeros?? |
4823 | name = xstrdup(b); | 4821 | name = xasprintf("%032lu", (unsigned long)len); |
4824 | 4822 | ||
4825 | str = xstrdup(p->l.t.v.v); | 4823 | str = xstrdup(p->l.t.v.v); |
4826 | bc_parse_push(p, BC_INST_STR); | 4824 | bc_parse_push(p, BC_INST_STR); |