Lines Matching refs:linebuf

689 static int sanitize_line(char *linebuf, int len, unsigned int flags, int first_call)
697 if (len > 3 && memcmp(linebuf, utf8_bom, 3) == 0) {
698 memmove(linebuf, linebuf + 3, len - 3);
699 linebuf[len - 3] = 0;
706 while ((len >= 0) && (linebuf[len] <= ' '))
712 if (!ossl_isbase64(linebuf[i]) || linebuf[i] == '\n'
713 || linebuf[i] == '\r')
721 if (linebuf[i] == '\n' || linebuf[i] == '\r')
723 if (ossl_iscntrl(linebuf[i]))
724 linebuf[i] = ' ';
729 linebuf[len++] = '\n';
730 linebuf[len] = '\0';
744 char *linebuf;
753 linebuf = pem_malloc(LINESIZE + 1, flags);
754 if (linebuf == NULL) {
760 len = BIO_gets(bp, linebuf, LINESIZE);
768 len = sanitize_line(linebuf, len, flags & ~PEM_FLAG_ONLY_B64, first_call);
772 } while (strncmp(linebuf, beginstr, BEGINLEN) != 0
774 || strncmp(linebuf + len - TAILLEN, tailstr, TAILLEN) != 0);
775 linebuf[len - TAILLEN] = '\0';
782 memcpy(*name, linebuf + BEGINLEN, len);
786 pem_free(linebuf, flags, LINESIZE + 1);
812 char *linebuf, *p;
821 linebuf = pem_malloc(LINESIZE + 1, flags);
822 if (linebuf == NULL) {
829 len = BIO_gets(bp, linebuf, LINESIZE);
841 partial_line_read = len == LINESIZE-1 && linebuf[LINESIZE-2] != '\n';
844 if (memchr(linebuf, ':', len) != NULL)
847 if (!strncmp(linebuf, endstr, ENDLEN) || got_header == IN_HEADER)
849 len = sanitize_line(linebuf, len, flags & flags_mask, 0);
852 if (linebuf[0] == '\n') {
870 if (strncmp(linebuf, endstr, ENDLEN) == 0) {
871 p = linebuf + ENDLEN;
892 if (BIO_puts(tmp, linebuf) < 0)
908 pem_free(linebuf, flags, LINESIZE + 1);