This commit is contained in:
Murilo Pereira 2011-05-08 01:29:16 -03:00
parent f48a3cee38
commit 22aa293645

View File

@ -63,18 +63,18 @@ bool empty(struct stack *stack) {
int length(struct stack *stack) { int length(struct stack *stack) {
int length; int length;
if (!empty(stack)) { if (empty(stack)) {
length = 0;
} else {
for (length = 1; stack->next; stack = stack->next, length++) for (length = 1; stack->next; stack = stack->next, length++)
; ;
} else {
length = 0;
} }
return(length); return(length);
} }
void push(struct stack **stack, struct card *card) { void push(struct stack **stack, struct card *card) {
struct stack *new_stack = NULL; struct stack *new_stack;
if (card) { if (card) {
if (empty(*stack)) { if (empty(*stack)) {