Skip to content

Commit

Permalink
fix -Wunused-but-set-variable
Browse files Browse the repository at this point in the history
  • Loading branch information
rurban committed Dec 1, 2024
1 parent 24b8fdb commit e73d99f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions core/string.c
Original file line number Diff line number Diff line change
Expand Up @@ -111,12 +111,12 @@ static PN potion_str_eval(Potion *P, PN cl, PN self) {
/// "number" method. as atoi/atof
static PN potion_str_number(Potion *P, PN cl, PN self) {
char *str = PN_STR_PTR(self);
int i = 0, dec = 0, sign = 0, len = PN_STR_LEN(self);
int i = 0, sign = 0, len = PN_STR_LEN(self);
if (len < 1) return PN_ZERO;

sign = (str[0] == '-' ? -1 : 1);
if (str[0] == '-' || str[0] == '+') {
dec++; str++; len--;
str++; len--;
}
for (i = 0; i < len; i++)
if (str[i] < '0' || str[i] > '9')
Expand Down

0 comments on commit e73d99f

Please sign in to comment.