Simple stack structure in C I just started to learn C, and for practicing, I tried to implement a simple stack data structure, and I want to know if I'm making any mistakes, or how could I improve it: 

My stack.h:

#ifndef STACK_H
#define STACK_H
#define STACK_MAX_SIZE 125

typedef struct
{
    int max_size;
    int items[STACK_MAX_SIZE];
    int position;
} Stack;

void stack_push(Stack *stack, int number);
int stack_pop(Stack *stack);
bool stack_is_empty(Stack *stack);

#endif


Stack.c:

#include &lt;stdio.h&gt;
#include &lt;stdbool.h&gt;
#include "stack.h"

void stack_push(Stack *stack, int number)
{
    if(stack-&gt;position &lt; 0){
        stack-&gt;position = 1;
    }
    stack-&gt;position++;

    stack-&gt;items[stack-&gt;position] = number;
}

int stack_pop(Stack *stack)
{
    if(stack-&gt;position == 0){
        fprintf(stderr, "Stack is empty");
        return -1;
    }
    int number = stack-&gt;items[stack-&gt;position];

    stack-&gt;position--;

    return number;
}

bool stack_is_empty(Stack *stack)
{
    return stack-&gt;position &lt; 1;
}


And the test:

#include &lt;stdarg.h&gt;
#include &lt;stddef.h&gt;
#include &lt;setjmp.h&gt;
#include &lt;cmocka.h&gt;
#include &lt;stdio.h&gt;
#include &lt;stdbool.h&gt;
#include "../src/stack.h"

static void stack_test() {
    Stack s, *stack = &amp;s;

    for(int i = 0; i &lt;= 5; i++){
        stack_push(stack, i);
    }

    assert_int_equal(stack_pop(stack), 5);

    while(false == stack_is_empty(stack)){
        stack_pop(stack);
    }

    assert_true(stack_is_empty(stack));
}

int main(void) {
    const struct CMUnitTest tests[] = {
        cmocka_unit_test(stack_test),
    };
    return cmocka_run_group_tests(tests, NULL, NULL);
}
Various thoughts

You never use the max_size field, so you should delete it.
When pushing, you never check to see if the stack is full, so you could overrun your array if you push too many items.
Your current implememtation does not utilize the first array slot items[0].  You could make a few easy changes to fix that.
You have a check for position &lt; 0 but it can never go negative.  You could even make position an unsigned value.

Rewrite
Here are your push and pop functions rewritten:
void stack_push(Stack *stack, int number)
{
    if (stack-&gt;position &gt;= STACK_MAX_SIZE) {
        fprintf(stderr, &quot;Stack is full\n&quot;);
        return;
    } 
    stack-&gt;items[stack-&gt;position++] = number;
}

int stack_pop(Stack *stack)
{
    if (stack-&gt;position == 0) {
        fprintf(stderr, &quot;Stack is empty\n&quot;);
        return -1;
    }
    return stack-&gt;items[--stack-&gt;position];
}