debugging stack.c. memory segmentation fault