]> git.wh0rd.org Git - nano.git/commitdiff
tweak new_file() to use mallocstrcpy() instead of charalloc() followed
authorDavid Lawrence Ramsey <pooka109@gmail.com>
Fri, 14 Jan 2005 17:17:11 +0000 (17:17 +0000)
committerDavid Lawrence Ramsey <pooka109@gmail.com>
Fri, 14 Jan 2005 17:17:11 +0000 (17:17 +0000)
by a null character initialization, for consistency

git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2264 35c25a1d-7b9e-4130-9fde-d3aeb78583b8

src/files.c

index 96abdb27d953a21108b94a8f7575fa1153ba9a9f..0df6c8fda1ed8d28896bd29454e1e5688727411f 100644 (file)
@@ -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;