2a3
> #include <ctype.h>
15c16
<            while(buf[i] != '+' && buf[i] !='-')
---
>            while(isdigit(buf[i]))
18c19
<            operator = buf[++i];
---
>            operator = buf[i++];
24a26
>