diff --git a/ChangeLog b/ChangeLog index 50dcfd63a84d711dffb017972e58cb48f19df3c2..785f9f7d69fd40bdb1b74b31d79ae10e3b621205 100644 --- a/ChangeLog +++ b/ChangeLog @@ -119,8 +119,7 @@ CVS code - - If the current filestruct's been partitioned, unpartition it before saving the associated file. (DLR) resize_variables() - - Use sizeof(char) in the memset() that initializes hblank - instead of assuming that the size of a char is 1. (DLR) + - Use charset() instead of memset() to initialize hblank. (DLR) copy_filestruct() - Rename variable prev to copy to avoid confusion. (DLR) print1opt_full() @@ -142,6 +141,8 @@ CVS code - disable_extended_input() - Disable extended output processing as well as extended input processing, and rename to disable_extended_io(). (DLR) +- nano.h: + - Add macro charset(), a wrapper that calls memset(). (DLR) - rcfile.c: color_to_int() - Since colorname's being NULL is handled elsewhere now, assert diff --git a/src/nano.c b/src/nano.c index f7fdb894f89a098be15c2a6ff23510ae88a15414..0a46a430dc80433e4a09fcff5e2a3a3c48afdf2e 100644 --- a/src/nano.c +++ b/src/nano.c @@ -212,7 +212,7 @@ void resize_variables(void) #endif hblank = charealloc(hblank, COLS + 1); - memset(hblank, ' ', COLS * sizeof(char)); + charset(hblank, ' ', COLS); hblank[COLS] = '\0'; } diff --git a/src/nano.h b/src/nano.h index 4997bb0e9a67e1a6650aef0f385ff0408040b3f9..1513f5b3d4c9433fadea15d51dcfd33e456c6a42 100644 --- a/src/nano.h +++ b/src/nano.h @@ -45,11 +45,12 @@ #define ISSET(bit) ((flags & bit) != 0) #define TOGGLE(bit) flags ^= bit -/* Macros for character allocation. */ +/* Macros for character allocation, etc. */ #define charalloc(howmuch) (char *)nmalloc((howmuch) * sizeof(char)) #define charealloc(ptr, howmuch) (char *)nrealloc(ptr, (howmuch) * sizeof(char)) #define charmove(dest, src, n) memmove(dest, src, (n) * sizeof(char)) #define charcpy(dest, src, n) memcpy(dest, src, (n) * sizeof(char)) +#define charset(dest, src, n) memset(dest, src, (n) * sizeof(char)) /* Other macros. */ #ifdef BROKEN_REGEXEC