can you post your code?
what is 'i' at the time you allocate your char array? is it > 0 ?