Skip to content

Commit 06ceeb7

Browse files
committed
Merge pull request #104 from plankp/master
Fixed naming clash with `base64` value 62 and 63
2 parents 40e199c + a072ee2 commit 06ceeb7

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

kernel/apps/calc.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ void calc(string args)
7979
print("\nUse calc -h for help\n> ", 0x0F);
8080

8181
readStr(calcInput, CALCSIZE);
82+
strcat(calcInput, "+0"); // Unary related hack! do not delete
8283

8384
for(int i = 0; i < CALCSIZE; i++)
8485
{
@@ -87,7 +88,7 @@ void calc(string args)
8788
else
8889
{
8990
int pInput = ctoi(calcInput[i]);
90-
if (pInput != -1)
91+
if ((pInput != -1) && (pInput != 62) && (pInput != 63))
9192
tempNum = concat(tempNum, pInput);
9293
else {
9394
// Properly check for math operator

kernel/apps/calc.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
#endif
1414

1515
// math storage variables
16-
char calcInput[CALCSIZE];
16+
char calcInput[CALCSIZE + 2]; // For `+0`
1717
int mathOp[CALCSIZE];
1818
int tempNum;
1919
double strNum[CALCSIZE];

0 commit comments

Comments
 (0)