diff options
author | Frederic Culot <calcurse@culot.org> | 2006-12-15 15:33:46 +0000 |
---|---|---|
committer | Frederic Culot <calcurse@culot.org> | 2006-12-15 15:33:46 +0000 |
commit | d94c02a2185f0c15f6e3bb5ae7242d8a747a9f96 (patch) | |
tree | e634ff26238cb192d0683a5d0e45ba0792474280 | |
parent | abec27e34cb7d098fd79acb2d00cb2f141c0bd5e (diff) | |
download | calcurse-d94c02a2185f0c15f6e3bb5ae7242d8a747a9f96.zip |
sprintf replaced by snprintf and strcpy replaced by strncpy
-rwxr-xr-x | src/utils.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/utils.c b/src/utils.c index 6d26b98..2b5d9cd 100755 --- a/src/utils.c +++ b/src/utils.c @@ -1,4 +1,4 @@ -/* $calcurse: utils.c,v 1.18 2006/12/14 08:28:21 culot Exp $ */ +/* $calcurse: utils.c,v 1.19 2006/12/15 15:33:46 culot Exp $ */ /* * Calcurse - text-based organizer @@ -76,13 +76,13 @@ WINDOW * popup(int pop_row, int pop_col, int pop_y, int pop_x, char *pop_lab) { char *txt_pop = _("Press any key to continue..."); - char label[80]; + char label[MAX_LENGTH]; WINDOW *popup_win; popup_win = newwin(pop_row, pop_col, pop_y, pop_x); custom_apply_attr(popup_win, ATTR_HIGHEST); box(popup_win, 0, 0); - sprintf(label, "%s", pop_lab); + snprintf(label, MAX_LENGTH, "%s", pop_lab); win_show(popup_win, label); mvwprintw(popup_win, pop_row - 2, pop_col - (strlen(txt_pop) + 1), "%s", txt_pop); @@ -745,7 +745,7 @@ char *mycpy(const char *src) char *string = malloc(strlen(src) + 1); if (string != NULL) - return strcpy(string, src); + return strncpy(string, src, strlen(src) + 1); else return NULL; } |