commit 23a260085d0fc84667a18a4bcb719c9cf448cf66
parent 31a7073c0dc115a514222f8ea11d210d55b3a60f
Author: kyle <kyle@0x30.net>
Date: Tue, 17 Jan 2017 19:38:18 -0700
lib: remove comment and use struct size in strncpy
Diffstat:
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/lib.c b/lib.c
@@ -42,9 +42,7 @@ add_header()
{
header = extend(sizeof(struct citrun_header));
- /* Must be exactly 4 bytes. */
strncpy(header->magic, "ctrn", sizeof(header->magic));
-
header->major = citrun_major;
header->minor = citrun_minor;
@@ -52,7 +50,7 @@ add_header()
get_prog_name(header->progname, sizeof(header->progname));
if (getcwd(header->cwd, sizeof(header->cwd)) == NULL)
- strncpy(header->cwd, "", 3);
+ strncpy(header->cwd, "", sizeof(header->cwd));
atexit(set_exited);
}