diff options
author | deraadt@openbsd.org <deraadt@openbsd.org> | 2015-08-20 22:32:42 +0000 |
---|---|---|
committer | Damien Miller <djm@mindrot.org> | 2015-08-21 13:43:25 +1000 |
commit | ce445b0ed927e45bd5bdce8f836eb353998dd65c (patch) | |
tree | 34170a772ddf573879b8ae244bafd6871be0fd11 /sftp.c | |
parent | 05291e5288704d1a98bacda269eb5a0153599146 (diff) |
upstream commit
Do not cast result of malloc/calloc/realloc* if stdlib.h
is in scope ok krw millert
Upstream-ID: 5e50ded78cadf3841556649a16cc4b1cb6c58667
Diffstat (limited to 'sftp.c')
-rw-r--r-- | sftp.c | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -1,4 +1,4 @@ -/* $OpenBSD: sftp.c,v 1.170 2015/01/20 23:14:00 deraadt Exp $ */ +/* $OpenBSD: sftp.c,v 1.171 2015/08/20 22:32:42 deraadt Exp $ */ /* * Copyright (c) 2001-2004 Damien Miller <djm@openbsd.org> * @@ -1958,7 +1958,7 @@ complete(EditLine *el, int ch) /* Figure out which argument the cursor points to */ cursor = lf->cursor - lf->buffer; - line = (char *)xmalloc(cursor + 1); + line = xmalloc(cursor + 1); memcpy(line, lf->buffer, cursor); line[cursor] = '\0'; argv = makeargv(line, &carg, 1, "e, &terminated); @@ -1966,7 +1966,7 @@ complete(EditLine *el, int ch) /* Get all the arguments on the line */ len = lf->lastchar - lf->buffer; - line = (char *)xmalloc(len + 1); + line = xmalloc(len + 1); memcpy(line, lf->buffer, len); line[len] = '\0'; argv = makeargv(line, &argc, 1, NULL, NULL); |