Skip to content

Commit

Permalink
Merge pull request #104 from plankp/master
Browse files Browse the repository at this point in the history
Fixed naming clash with `base64` value 62 and 63
  • Loading branch information
plankp committed Nov 29, 2015
2 parents 40e199c + a072ee2 commit 06ceeb7
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion kernel/apps/calc.c
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ void calc(string args)
print("\nUse calc -h for help\n> ", 0x0F);

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

for(int i = 0; i < CALCSIZE; i++)
{
Expand All @@ -87,7 +88,7 @@ void calc(string args)
else
{
int pInput = ctoi(calcInput[i]);
if (pInput != -1)
if ((pInput != -1) && (pInput != 62) && (pInput != 63))
tempNum = concat(tempNum, pInput);
else {
// Properly check for math operator
Expand Down
2 changes: 1 addition & 1 deletion kernel/apps/calc.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
#endif

// math storage variables
char calcInput[CALCSIZE];
char calcInput[CALCSIZE + 2]; // For `+0`
int mathOp[CALCSIZE];
int tempNum;
double strNum[CALCSIZE];
Expand Down

0 comments on commit 06ceeb7

Please sign in to comment.