blob: cdc4a93fedce07b40c8194e06e45b5ca821fd8f0 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
|
--- a/hexcalc.c 1989-11-22 16:29:06.000000000 -0500
+++ b/hexcalc.c 2006-07-18 17:36:40.000000000 -0400
@@ -37,6 +37,7 @@
#endif
#include <stdio.h>
+#include <stdlib.h>
#include <ctype.h>
#include <X11/IntrinsicP.h>
#include <X11/StringDefs.h>
@@ -509,14 +508,16 @@
switch(topOp) {
case '+' :
- ac = PopArg() + PopArg();
+ temp = PopArg();
+ ac = PopArg() + temp;
break;
case '-' :
temp = PopArg();
ac = PopArg() - temp;
break;
case '*' :
- ac = PopArg() * PopArg();
+ temp = PopArg();
+ ac = temp * PopArg();
break;
case '/' :
temp = PopArg();
@@ -528,15 +529,18 @@
break;
case '|' :
- ac = PopArg() | PopArg();
+ temp = PopArg();
+ ac = temp | PopArg();
break;
case '&' :
- ac = PopArg() & PopArg();
+ temp = PopArg();
+ ac = temp & PopArg();
break;
case '^' :
- ac = PopArg() ^ PopArg();
+ temp = PopArg();
+ ac = temp ^ PopArg();
break;
case '<' :
|