From: David Lawrence Ramsey Date: Fri, 14 Jan 2005 17:17:11 +0000 (+0000) Subject: tweak new_file() to use mallocstrcpy() instead of charalloc() followed X-Git-Tag: v1.3.6~138 X-Git-Url: https://git.wh0rd.org/?a=commitdiff_plain;h=f6e4d33afcbfe6efcd9bcbae1c1a60fa4e18454e;p=nano.git tweak new_file() to use mallocstrcpy() instead of charalloc() followed by a null character initialization, for consistency git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2264 35c25a1d-7b9e-4130-9fde-d3aeb78583b8 --- diff --git a/src/files.c b/src/files.c index 96abdb27..0df6c8fd 100644 --- a/src/files.c +++ b/src/files.c @@ -45,8 +45,7 @@ static file_format fmt = NIX_FILE; void new_file(void) { fileage = make_new_node(NULL); - fileage->data = charalloc(1); - fileage->data[0] = '\0'; + fileage->data = mallocstrcpy(NULL, ""); filebot = fileage; edittop = fileage; current = fileage;