That will always be 255
You want to call strlen() which will be the actual length of the text in the line (including the carriage return)
Also there is probably no need for
memset(line, 0, sizeof line);//clear array
If you want to reset the cString, just put a null char in the first byte
line[0] = '\0';