Without looking closely, your malloc appears wrong:
> prog *run;
>
> run = (prog *) malloc (sizeof (run));
It should be:
run = (prog *) malloc (sizeof (prog));
--
Bill Rausch
"Try to learn something about everything and everything about something."
(Thomas H. Huxley)