summaryrefslogtreecommitdiffstats
path: root/usr.bin/dc
diff options
context:
space:
mode:
authorsjg <sjg@FreeBSD.org>2015-05-27 01:19:58 +0000
committersjg <sjg@FreeBSD.org>2015-05-27 01:19:58 +0000
commit65145fa4c81da358fcbc3b650156dab705dfa34e (patch)
tree55c065b6730aaac2afb6c29933ee6ec5fa4c4249 /usr.bin/dc
parent60ff4eb0dff94a04d75d0d52a3957aaaf5f8c693 (diff)
parente6b664c390af88d4a87208bc042ce503da664c3b (diff)
downloadFreeBSD-src-65145fa4c81da358fcbc3b650156dab705dfa34e.zip
FreeBSD-src-65145fa4c81da358fcbc3b650156dab705dfa34e.tar.gz
Merge sync of head
Diffstat (limited to 'usr.bin/dc')
-rw-r--r--usr.bin/dc/Makefile3
-rw-r--r--usr.bin/dc/stack.c6
2 files changed, 4 insertions, 5 deletions
diff --git a/usr.bin/dc/Makefile b/usr.bin/dc/Makefile
index 67af146..832b197 100644
--- a/usr.bin/dc/Makefile
+++ b/usr.bin/dc/Makefile
@@ -3,7 +3,6 @@
PROG= dc
SRCS= dc.c bcode.c inout.c mem.c stack.c
-DPADD= ${LIBCRYPTO}
-LDADD= -lcrypto
+LIBADD= crypto
.include <bsd.prog.mk>
diff --git a/usr.bin/dc/stack.c b/usr.bin/dc/stack.c
index 950b4e5..3364ae2 100644
--- a/usr.bin/dc/stack.c
+++ b/usr.bin/dc/stack.c
@@ -137,14 +137,12 @@ stack_swap(struct stack *stack)
static void
stack_grow(struct stack *stack)
{
- size_t i, new_size;
+ size_t new_size;
if (++stack->sp == stack->size) {
new_size = stack->size * 2 + 1;
stack->stack = brealloc(stack->stack,
new_size * sizeof(*stack->stack));
- for (i = stack->size; i < new_size; i++)
- stack->stack[i].array = NULL;
stack->size = new_size;
}
}
@@ -156,6 +154,7 @@ stack_pushnumber(struct stack *stack, struct number *b)
stack_grow(stack);
stack->stack[stack->sp].type = BCODE_NUMBER;
stack->stack[stack->sp].u.num = b;
+ stack->stack[stack->sp].array = NULL;
}
void
@@ -165,6 +164,7 @@ stack_pushstring(struct stack *stack, char *string)
stack_grow(stack);
stack->stack[stack->sp].type = BCODE_STRING;
stack->stack[stack->sp].u.string = string;
+ stack->stack[stack->sp].array = NULL;
}
void
OpenPOWER on IntegriCloud