Meh.
This commit is contained in:
parent
f48a3cee38
commit
22aa293645
@ -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)) {
|
||||||
|
Loading…
Reference in New Issue
Block a user