commit 054559dc9367b893f50599c7e3c8e624be9a53e4
parent fdeab9b4c9f4c522448b8fe252aca6bfc42cb528
Author: Benno Schulenberg <bensberg@telfort.nl>
Date: Tue, 15 Oct 2019 16:27:36 +0200
tweaks: rename three variables, to be more descriptive
Diffstat:
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/src/utils.c b/src/utils.c
@@ -324,14 +324,14 @@ 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)
+/* Return an allocated copy of the first count characters of the given string. */
+char *measured_copy(const char *string, size_t count)
{
- char *dest = charalloc(n);
+ char *thecopy = charalloc(count);
- strncpy(dest, src, n);
+ strncpy(thecopy, string, count);
- return dest;
+ return thecopy;
}
/* Return an allocated copy of the given string. */