Updated temper.c to handle NULL pointer