- 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()
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
#endif
hblank = charealloc(hblank, COLS + 1);
- memset(hblank, ' ', COLS * sizeof(char));
+ charset(hblank, ' ', COLS);
hblank[COLS] = '\0';
}
#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