why is this code of my giving run-time error on www.ideone.com?

#include<stdio.h>
#include<stdlib.h>
#define size 1000000000
int main()
{
long int t,c,i,input;
scanf("%ld",&t);
char buffer;
buffer=(char
)malloc(sizeof(char)(sizet));
c=fread(buffer,sizeof(char),sizet,stdin);
input=0;
for(i=1;i<c;i++)
{
if(buffer[i]==’\n’ || i==c-1)
{
printf("%d\n",count(input));
input=0;
}
else{
input=input
10+(buffer[i]-‘0’);
}
}
return 0;
}
int count(int x)
{
int cnt,i,val,val2,cnt2;
cnt=0;val=1,val2=1;
for(i=1;i<=x;i++)
{
cnt2=0;
val=val*i;
val2=val;
while(val2%10==0)
{
cnt2++;
val2=val2/10;
}
if(cnt2>cnt)
cnt=cnt2;
}
return cnt;
}

//