diff --git a/src/exch.c b/src/exch.c index c5c5552..19ff2d0 100644 --- a/src/exch.c +++ b/src/exch.c @@ -412,7 +412,7 @@ void visit_bank (void) mkchstr(chbuf, BUFSIZE, attr_normal, attr_normal | A_BOLD, 0, 1, getmaxx(curwin) / 2, &width_cursym, 1, "^{%s^}", lconvinfo.currency_symbol); - chbuf_cursym = chstrdup(chbuf, BUFSIZE); + chbuf_cursym = chstrdup(chbuf); mkchstr(chbuf, BUFSIZE, attr_normal, 0, 0, 1, getmaxx(curwin) - BANK_INPUT_COLS - width_cursym - 6, &width, 1, @@ -470,7 +470,7 @@ void visit_bank (void) mkchstr(chbuf, BUFSIZE, attr_normal, attr_normal | A_BOLD, 0, 1, getmaxx(curwin) / 2, &width_cursym, 1, "^{%s^}", lconvinfo.currency_symbol); - chbuf_cursym = chstrdup(chbuf, BUFSIZE); + chbuf_cursym = chstrdup(chbuf); mkchstr(chbuf, BUFSIZE, attr_normal, 0, 0, 1, getmaxx(curwin) - BANK_INPUT_COLS - width_cursym - 6, &width, 1, diff --git a/src/intf.c b/src/intf.c index 03cf18f..94b1aa1 100644 --- a/src/intf.c +++ b/src/intf.c @@ -1241,7 +1241,7 @@ error: /***********************************************************************/ // chstrdup: Duplicate a chtype buffer -chtype *chstrdup (const chtype *restrict chstr, int chstrsize) +chtype *chstrdup (const chtype *restrict chstr) { const chtype *p; int len; @@ -1249,7 +1249,7 @@ chtype *chstrdup (const chtype *restrict chstr, int chstrsize) // Determine chstr length, including ending NUL - for (len = 1, p = chstr; *p != '\0' && len <= chstrsize; p++, len++) + for (len = 1, p = chstr; *p != '\0'; p++, len++) ; ret = xmalloc(len * sizeof(chtype)); diff --git a/src/intf.h b/src/intf.h index 89c5791..ee53f33 100644 --- a/src/intf.h +++ b/src/intf.h @@ -412,7 +412,6 @@ extern int vmkchstr (chtype *restrict chbuf, int chbufsize, chtype attr_norm, /* Function: chstrdup - Duplicate a chtype string Parameters: chstr - String to duplicate - chstrsize - Maximum number of chtype elements in chstr Returns: chtype * - Pointer to new (duplicated) string This function returns a new string of type chtype * that contains a @@ -420,7 +419,7 @@ extern int vmkchstr (chtype *restrict chbuf, int chbufsize, chtype attr_norm, memory is not available, the program terminates with an "Out of memory" message. */ -extern chtype *chstrdup (const chtype *restrict chstr, int chstrsize); +extern chtype *chstrdup (const chtype *restrict chstr); /* diff --git a/src/move.c b/src/move.c index 14fb280..353d73c 100644 --- a/src/move.c +++ b/src/move.c @@ -788,11 +788,11 @@ void merge_companies (map_val_t a, map_val_t b) mkchstr(chbuf, BUFSIZE, attr_highlight, 0, 0, 1, getmaxx(curwin) / 2, &width_aa, 1, "%s", company[aa].name); - chbuf_aa = chstrdup(chbuf, BUFSIZE); + chbuf_aa = chstrdup(chbuf); mkchstr(chbuf, BUFSIZE, attr_highlight, 0, 0, 1, getmaxx(curwin) / 2, &width_bb, 1, "%s", company[bb].name); - chbuf_bb = chstrdup(chbuf, BUFSIZE); + chbuf_bb = chstrdup(chbuf); mkchstr(chbuf, BUFSIZE, attr_normal, 0, 0, 1, getmaxx(curwin) / 2, &width, 1, @@ -1032,7 +1032,7 @@ void adjust_values (void) mkchstr(chbuf, BUFSIZE, attr_error_highlight, 0, 0, 1, w / 2, &width_amt, 1, "%N", company[which].share_price); - chbuf_amt = chstrdup(chbuf, BUFSIZE); + chbuf_amt = chstrdup(chbuf); mkchstr(chbuf, BUFSIZE, attr_error_normal, 0, 0, 1, w / 2, &width, 1,