aboutsummaryrefslogtreecommitdiff
path: root/shell
diff options
context:
space:
mode:
authorEric Andersen <andersen@codepoet.org>2002-03-20 14:31:15 +0000
committerEric Andersen <andersen@codepoet.org>2002-03-20 14:31:15 +0000
commit889a301a0c992cef843322ba7d2af62fcf44ab2a (patch)
treeacf535945e56f7d18e41334a477c44dc2fbddd31 /shell
parent900c24dc4e98edb5fdb96035028f5d344ce72792 (diff)
downloadbusybox-889a301a0c992cef843322ba7d2af62fcf44ab2a.tar.gz
Patch from vodz to fix a potential segfault
Diffstat (limited to 'shell')
-rw-r--r--shell/cmdedit.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/shell/cmdedit.c b/shell/cmdedit.c
index d4d6264d0..3810c230a 100644
--- a/shell/cmdedit.c
+++ b/shell/cmdedit.c
@@ -799,8 +799,8 @@ static int match_compare(const void *a, const void *b)
#define QUOT (UCHAR_MAX+1)
#define collapse_pos(is, in) { \
- memcpy(int_buf+is, int_buf+in, (BUFSIZ+1-is-in)*sizeof(int)); \
- memcpy(pos_buf+is, pos_buf+in, (BUFSIZ+1-is-in)*sizeof(int)); }
+ memcpy(int_buf+(is), int_buf+(in), (BUFSIZ+1-(is)-(in))*sizeof(int)); \
+ memcpy(pos_buf+(is), pos_buf+(in), (BUFSIZ+1-(is)-(in))*sizeof(int)); }
static int find_match(char *matchBuf, int *len_with_quotes)
{