Fixed with malloc and got rid of all warning messages