nano

nano with my custom patches
git clone git://bsandro.tech/nano
Log | Files | Refs | README | LICENSE

commit fdeab9b4c9f4c522448b8fe252aca6bfc42cb528
parent f26c121ca90f8edf841759bf97d3164a9e14cf94
Author: Benno Schulenberg <bensberg@telfort.nl>
Date:   Tue, 15 Oct 2019 16:24:06 +0200

tweaks: order two functions more sensibly

Diffstat:
Msrc/utils.c | 20++++++++++----------
1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/src/utils.c b/src/utils.c @@ -312,16 +312,6 @@ void *nrealloc(void *ptr, size_t howmuch) return r; } -/* Return an allocated copy of the first n characters of the given string. */ -char *measured_copy(const char *src, size_t n) -{ - char *dest = charalloc(n); - - strncpy(dest, src, n); - - return dest; -} - /* Return an appropriately reallocated dest string holding a copy of src. * Usage: "dest = mallocstrcpy(dest, src);". */ char *mallocstrcpy(char *dest, const char *src) @@ -334,6 +324,16 @@ char *mallocstrcpy(char *dest, const char *src) return dest; } +/* Return an allocated copy of the first n characters of the given string. */ +char *measured_copy(const char *src, size_t n) +{ + char *dest = charalloc(n); + + strncpy(dest, src, n); + + return dest; +} + /* Return an allocated copy of the given string. */ char *copy_of(const char *string) {