Lines Matching refs:str
92 int BUF_MEM_grow(BUF_MEM *str, int len)
97 if (str->length >= len)
99 str->length=len;
102 if (str->max >= len)
104 memset(&str->data[str->length],0,len-str->length);
105 str->length=len;
109 if (str->data == NULL)
112 ret=OPENSSL_realloc(str->data,n);
120 str->data=ret;
121 str->max=n;
122 memset(&str->data[str->length],0,len-str->length);
123 str->length=len;
128 int BUF_MEM_grow_clean(BUF_MEM *str, int len)
133 if (str->length >= len)
135 memset(&str->data[len],0,str->length-len);
136 str->length=len;
139 if (str->max >= len)
141 memset(&str->data[str->length],0,len-str->length);
142 str->length=len;
146 if (str->data == NULL)
149 ret=OPENSSL_realloc_clean(str->data,str->max,n);
157 str->data=ret;
158 str->max=n;
159 memset(&str->data[str->length],0,len-str->length);
160 str->length=len;
165 char *BUF_strdup(const char *str)
167 if (str == NULL) return(NULL);
168 return BUF_strndup(str, strlen(str));
171 char *BUF_strndup(const char *str, size_t siz)
175 if (str == NULL) return(NULL);
183 BUF_strlcpy(ret,str,siz+1);