unary operator expected

i=0
while [ $i -le $buf ]

Shell script reports an error "unary operator expected" pointing the above line.
$i by default is 0 and holds integer value and $buf is also holding integer value.

Please can some one let me know what is missing.

Thanks.

Please post few more lines of the code and also let us know the shell and the OS you are working with..