From 9bf2df7ea3567fc8a48e36d3f64988d220cd69bd Mon Sep 17 00:00:00 2001 From: Theo de Raadt Date: Sun, 6 Apr 2003 23:39:18 +0000 Subject: strlcat; ok from various people --- bin/ksh/history.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'bin/ksh') diff --git a/bin/ksh/history.c b/bin/ksh/history.c index 4ec7d6b2e8a..d7432d7d77d 100644 --- a/bin/ksh/history.c +++ b/bin/ksh/history.c @@ -1,4 +1,4 @@ -/* $OpenBSD: history.c,v 1.17 2003/02/28 09:45:09 jmc Exp $ */ +/* $OpenBSD: history.c,v 1.18 2003/04/06 23:39:17 deraadt Exp $ */ /* * command history @@ -93,8 +93,9 @@ c_fc(wp) if (strcmp(p, "-") == 0) sflag++; else { - editor = str_nsave(p, strlen(p) + 4, ATEMP); - strcat(editor, " $_"); + size_t len = strlen(p) + 4; + editor = str_nsave(p, len, ATEMP); + strlcat(editor, " $_", len); } break; case 'g': /* non-at&t ksh */ -- cgit v1.2.3