From a35ec048d7934e5e90256e42aabf8a6d05349bd3 Mon Sep 17 00:00:00 2001 From: Chris Allegretta Date: Mon, 15 Jan 2001 02:26:12 +0000 Subject: [PATCH] files.c:cwd_tab_completion(), input_tab(): Changed bare malloc/calloc calls to nmalloc (found by Rocco). git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@478 35c25a1d-7b9e-4130-9fde-d3aeb78583b8 --- ChangeLog | 2 ++ files.c | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 65360dc2..af7ec042 100644 --- a/ChangeLog +++ b/ChangeLog @@ -26,6 +26,8 @@ General Neil Parks). do_browser() - Added space and - keys to do page up and down. + cwd_tab_completion(), input_tab() + - Changed bare malloc/calloc calls to nmalloc (found by Rocco). - nano.c: ABCD() - New function, figures out what kbinput to return given diff --git a/files.c b/files.c index 01d9ff1a..ebb0acda 100644 --- a/files.c +++ b/files.c @@ -796,7 +796,7 @@ char **cwd_tab_completion(char *buf, int *num_matches) /* Okie, if there's a / in the buffer, strip out the directory part */ if (strcmp(buf, "") && strstr(buf, "/")) { - dirName = malloc(strlen(buf) + 1); + dirName = nmalloc(strlen(buf) + 1); tmp = buf + strlen(buf); while (*tmp != '/' && tmp != buf) tmp--; @@ -882,7 +882,7 @@ char *input_tab(char *buf, int place, int *lastWasTab, int *newplace) /* Make a local copy of the string -- up to the position of the cursor */ - matchBuf = (char *) calloc(strlen(buf) + 2, sizeof(char)); + matchBuf = (char *) nmalloc((strlen(buf) + 2) * sizeof(char)); strncpy(matchBuf, buf, place); tmp = matchBuf; -- 2.39.5