comparison src/getchar.c @ 416:3da34f87c760

updated for version 7.0109
author vimboss
date Mon, 18 Jul 2005 21:40:44 +0000
parents bda4394122e0
children 3709cf52b9b5
comparison
equal deleted inserted replaced
415:165c628aa9fc 416:3da34f87c760
255 buf->bh_index = 0; 255 buf->bh_index = 0;
256 256
257 if (buf->bh_space >= (int)slen) 257 if (buf->bh_space >= (int)slen)
258 { 258 {
259 len = (long_u)STRLEN(buf->bh_curr->b_str); 259 len = (long_u)STRLEN(buf->bh_curr->b_str);
260 STRNCPY(buf->bh_curr->b_str + len, s, slen); 260 vim_strncpy(buf->bh_curr->b_str + len, s, (size_t)slen);
261 buf->bh_curr->b_str[len + slen] = NUL;
262 buf->bh_space -= slen; 261 buf->bh_space -= slen;
263 } 262 }
264 else 263 else
265 { 264 {
266 if (slen < MINIMAL_SIZE) 265 if (slen < MINIMAL_SIZE)
270 p = (struct buffblock *)lalloc((long_u)(sizeof(struct buffblock) + len), 269 p = (struct buffblock *)lalloc((long_u)(sizeof(struct buffblock) + len),
271 TRUE); 270 TRUE);
272 if (p == NULL) 271 if (p == NULL)
273 return; /* no space, just forget it */ 272 return; /* no space, just forget it */
274 buf->bh_space = len - slen; 273 buf->bh_space = len - slen;
275 STRNCPY(p->b_str, s, slen); 274 vim_strncpy(p->b_str, s, (size_t)slen);
276 p->b_str[slen] = NUL;
277 275
278 p->b_next = buf->bh_curr->b_next; 276 p->b_next = buf->bh_curr->b_next;
279 buf->bh_curr->b_next = p; 277 buf->bh_curr->b_next = p;
280 buf->bh_curr = p; 278 buf->bh_curr = p;
281 } 279 }