Lines Matching refs:cnt

834 	ssize_t cnt = 0; // Number of characters currently in the buffer.
840 if (buf == NULL || cnt + 2 >= len) {
844 cnt = ENOMEM;
854 cnt = errno;
855 if (cnt >= 0)
856 cnt = -1; // Error codes must be negative.
861 if (cnt > 0) {
862 buf[cnt++] = '\n';
863 if (buf[cnt-2] == '\r') {
864 buf[cnt-2] = '\n';
865 --cnt;
872 buf[cnt++] = c;
877 if (cnt >= 2 && buf[cnt-2] == '\r') {
878 buf[cnt-2] = '\n';
879 --cnt;
883 if (cnt <= 1)
888 buf[cnt-1] = c; // Replace \n with the white space character.
897 if (buf != NULL && cnt >= 0)
898 buf[cnt] = '\0';
908 return cnt;
917 ssize_t cnt = 0; // Number of characters currently in the buffer.
924 if (buf == NULL || cnt + 2 >= len) {
928 cnt = ENOMEM;
938 cnt = errorCode; // IO error encountered, just return the code.
943 if (cnt > 0) {
944 buf[cnt++] = '\n';
945 if (buf[cnt-2] == '\r') {
946 buf[cnt-2] = '\n';
947 --cnt;
954 buf[cnt++] = c;
959 if (cnt >= 2 && buf[cnt-2] == '\r') {
960 buf[cnt-2] = '\n';
961 --cnt;
965 if (cnt <= 1)
971 buf[cnt-1] = c; // Replace \n with the white space character.
978 cnt = errorCode;
985 if (buf != NULL && cnt >= 0)
986 buf[cnt] = '\0';
996 return cnt;
1005 ssize_t cnt = 0; // Number of characters currently in the buffer.
1012 if (buf == NULL || cnt + 2 >= len)
1017 cnt = ENOMEM;
1029 if (cnt > 0) {
1030 buf[cnt++] = '\n';
1031 if (buf[cnt-2] == '\r') {
1032 buf[cnt-2] = '\n';
1033 --cnt;
1039 buf[cnt++] = c;
1044 if (cnt >= 2 && buf[cnt-2] == '\r') {
1045 buf[cnt-2] = '\n';
1046 --cnt;
1050 if (cnt <= 1)
1055 buf[cnt-1] = c; // Replace \n with the white space character.
1065 if (buf != NULL && cnt >= 0)
1066 buf[cnt] = '\0';
1076 return cnt;