comparison src/misc2.c @ 5110:dafd77a15d44 v7.3.1298

updated for version 7.3.1298 Problem: Crash. Solution: Use STRCPY() instead of STRCAT() and allocate one more byte.
author Bram Moolenaar <bram@vim.org>
date Wed, 03 Jul 2013 17:51:17 +0200
parents cb0a5c9c0f9b
children 6cabac58f26f
comparison
equal deleted inserted replaced
5109:cdf30ced9b5c 5110:dafd77a15d44
4678 goto error_return; 4678 goto error_return;
4679 } 4679 }
4680 STRCPY(ff_expand_buffer, search_ctx->ffsc_start_dir); 4680 STRCPY(ff_expand_buffer, search_ctx->ffsc_start_dir);
4681 add_pathsep(ff_expand_buffer); 4681 add_pathsep(ff_expand_buffer);
4682 { 4682 {
4683 char_u *buf = alloc(STRLEN(ff_expand_buffer) 4683 int eb_len = STRLEN(ff_expand_buffer);
4684 + STRLEN(search_ctx->ffsc_fix_path)); 4684 char_u *buf = alloc(eb_len + STRLEN(search_ctx->ffsc_fix_path) + 1);
4685 4685
4686 STRCPY(buf, ff_expand_buffer); 4686 STRCPY(buf, ff_expand_buffer);
4687 STRCAT(buf, search_ctx->ffsc_fix_path); 4687 STRCPY(buf + eb_len, search_ctx->ffsc_fix_path);
4688 if (mch_isdir(buf)) 4688 if (mch_isdir(buf))
4689 { 4689 {
4690 STRCAT(ff_expand_buffer, search_ctx->ffsc_fix_path); 4690 STRCAT(ff_expand_buffer, search_ctx->ffsc_fix_path);
4691 add_pathsep(ff_expand_buffer); 4691 add_pathsep(ff_expand_buffer);
4692 } 4692 }