Mercurial > vim
comparison src/misc1.c @ 2768:c5e47b752f07 v7.3.160
updated for version 7.3.160
Problem: Unsafe string copying.
Solution: Use vim_strncpy() instead of strcpy(). Use vim_strcat() instead
of strcat().
author | Bram Moolenaar <bram@vim.org> |
---|---|
date | Mon, 11 Apr 2011 16:56:35 +0200 |
parents | b5f774f15927 |
children | cdefcbb70e8c |
comparison
equal
deleted
inserted
replaced
2767:9d6d058f0ebb | 2768:c5e47b752f07 |
---|---|
3330 if (pn > p_report) | 3330 if (pn > p_report) |
3331 { | 3331 { |
3332 if (pn == 1) | 3332 if (pn == 1) |
3333 { | 3333 { |
3334 if (n > 0) | 3334 if (n > 0) |
3335 STRCPY(msg_buf, _("1 more line")); | 3335 vim_strncpy(msg_buf, (char_u *)_("1 more line"), |
3336 MSG_BUF_LEN - 1); | |
3336 else | 3337 else |
3337 STRCPY(msg_buf, _("1 line less")); | 3338 vim_strncpy(msg_buf, (char_u *)_("1 line less"), |
3339 MSG_BUF_LEN - 1); | |
3338 } | 3340 } |
3339 else | 3341 else |
3340 { | 3342 { |
3341 if (n > 0) | 3343 if (n > 0) |
3342 sprintf((char *)msg_buf, _("%ld more lines"), pn); | 3344 vim_snprintf((char *)msg_buf, MSG_BUF_LEN, |
3345 _("%ld more lines"), pn); | |
3343 else | 3346 else |
3344 sprintf((char *)msg_buf, _("%ld fewer lines"), pn); | 3347 vim_snprintf((char *)msg_buf, MSG_BUF_LEN, |
3348 _("%ld fewer lines"), pn); | |
3345 } | 3349 } |
3346 if (got_int) | 3350 if (got_int) |
3347 STRCAT(msg_buf, _(" (Interrupted)")); | 3351 vim_strcat(msg_buf, (char_u *)_(" (Interrupted)"), MSG_BUF_LEN); |
3348 if (msg(msg_buf)) | 3352 if (msg(msg_buf)) |
3349 { | 3353 { |
3350 set_keep_msg(msg_buf, 0); | 3354 set_keep_msg(msg_buf, 0); |
3351 keep_msg_more = TRUE; | 3355 keep_msg_more = TRUE; |
3352 } | 3356 } |