File tree Expand file tree Collapse file tree 2 files changed +3
-2
lines changed
Expand file tree Collapse file tree 2 files changed +3
-2
lines changed Original file line number Diff line number Diff 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
Original file line number Diff line number Diff line change 1313#endif
1414
1515// math storage variables
16- char calcInput [CALCSIZE ];
16+ char calcInput [CALCSIZE + 2 ]; // For `+0`
1717int mathOp [CALCSIZE ];
1818int tempNum ;
1919double strNum [CALCSIZE ];
You can’t perform that action at this time.
0 commit comments