From 6d9aa085d166cf4ba3cbd5f41a1a4cdd285c271f Mon Sep 17 00:00:00 2001 From: David Lawrence Ramsey Date: Wed, 3 Nov 2004 14:58:04 +0000 Subject: [PATCH] cosmetic fixes git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2047 35c25a1d-7b9e-4130-9fde-d3aeb78583b8 --- src/nano.h | 11 +++++------ src/utils.c | 3 +-- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/src/nano.h b/src/nano.h index fbf81163..163463a2 100644 --- a/src/nano.h +++ b/src/nano.h @@ -209,17 +209,16 @@ typedef struct toggle { long flag; /* What flag actually gets toggled. */ struct toggle *next; } toggle; -#endif /* !NANO_SMALL */ +#endif #ifdef ENABLE_NANORC typedef struct rcoption { const char *name; long flag; } rcoption; -#endif /* ENABLE_NANORC */ +#endif #ifdef ENABLE_COLOR - typedef struct colortype { int fg; /* fg color */ int bg; /* bg color */ @@ -241,8 +240,7 @@ typedef struct syntaxtype { colortype *color; /* color struct for this syntax */ struct syntaxtype *next; } syntaxtype; - -#endif /* ENABLE_COLOR */ +#endif #ifndef NANO_SMALL typedef struct historytype { @@ -250,6 +248,7 @@ typedef struct historytype { struct historytype *prev; char *data; } historytype; + typedef struct historyheadtype { struct historytype *next; /* Keep *next and *prev members * together. */ @@ -260,7 +259,7 @@ typedef struct historyheadtype { int count; int len; } historyheadtype; -#endif /* !NANO_SMALL */ +#endif /* Bitwise flags so we can save space (or more correctly, not waste * it). */ diff --git a/src/utils.c b/src/utils.c index b113cb95..1a52e1f9 100644 --- a/src/utils.c +++ b/src/utils.c @@ -431,8 +431,7 @@ char *mallocstrassn(char *dest, char *src) void new_magicline(void) { filebot->next = (filestruct *)nmalloc(sizeof(filestruct)); - filebot->next->data = charalloc(1); - filebot->next->data[0] = '\0'; + filebot->next->data = mallocstrcpy(NULL, ""); filebot->next->prev = filebot; filebot->next->next = NULL; filebot->next->lineno = filebot->lineno + 1; -- 2.39.5