diff options
Diffstat (limited to 'gnu/lib/libreadline/histexpand.c')
-rw-r--r-- | gnu/lib/libreadline/histexpand.c | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/gnu/lib/libreadline/histexpand.c b/gnu/lib/libreadline/histexpand.c index 4c42a213c0e..78da3e585a6 100644 --- a/gnu/lib/libreadline/histexpand.c +++ b/gnu/lib/libreadline/histexpand.c @@ -341,7 +341,7 @@ hist_error(s, start, current, errtype) int start, current, errtype; { char *temp, *emsg; - int ll, elen, len; + int ll, elen; ll = current - start; @@ -373,11 +373,11 @@ hist_error(s, start, current, errtype) break; } - len = ll + elen + 3; - temp = xmalloc (len); + temp = xmalloc (ll + elen + 3); strncpy (temp, s + start, ll); - strlcat (temp, ": ", len); - strlcat (temp, emsg, len); + temp[ll] = ':'; + temp[ll + 1] = ' '; + strcpy (temp + ll + 2, emsg); return (temp); } @@ -443,7 +443,7 @@ postproc_subst_rhs () { if (j + subst_lhs_len >= new_size) new = xrealloc (new, (new_size = new_size * 2 + subst_lhs_len)); - strlcpy (new + j, subst_lhs, new_size - j); + strcpy (new + j, subst_lhs); j += subst_lhs_len; } else @@ -754,7 +754,7 @@ history_expand_internal (string, start, end_index_ptr, ret_string, current_line) n = strlen (temp); if (n >= result_len) result = xrealloc (result, n + 2); - strlcpy (result, temp, n + 2); + strcpy (result, temp); free (temp); *end_index_ptr = i; @@ -786,7 +786,7 @@ history_expand_internal (string, start, end_index_ptr, ret_string, current_line) result_len += 128; \ result = xrealloc (result, result_len); \ } \ - strlcpy (result + j - sl, s, result_len - j + sl); \ + strcpy (result + j - sl, s); \ } \ while (0) @@ -847,7 +847,7 @@ history_expand (hstring, output) string[0] = string[1] = history_expansion_char; string[2] = ':'; string[3] = 's'; - strlcpy (string + 4, hstring, l - 4); + strcpy (string + 4, hstring); l += 4; } else @@ -966,7 +966,7 @@ history_expand (hstring, output) if (i == 0 || member (string[i - 1], HISTORY_WORD_DELIMITERS)) { temp = xmalloc (l - i + 1); - strlcpy (temp, string + i, l - i + 1); + strcpy (temp, string + i); ADD_STRING (temp); free (temp); i = l; @@ -998,7 +998,7 @@ history_expand (hstring, output) if (result) { temp = xmalloc (1 + strlen (result)); - strlcpy (temp, result, 1 + strlen(result)); + strcpy (temp, result); ADD_STRING (temp); free (temp); } @@ -1192,7 +1192,7 @@ history_arg_extract (first, last, string) for (i = first, offset = 0; i < last; i++) { - strlcpy (result + offset, list[i], size + 1 - offset); + strcpy (result + offset, list[i]); offset += strlen (list[i]); if (i + 1 < last) { |