[Git][NTPsec/ntpsec][master] In nts_lib.c, use memcpy rather than Linux-only mempcpy.

Eric S. Raymond gitlab at mg.gitlab.com
Wed Feb 6 03:09:30 UTC 2019


Eric S. Raymond pushed to branch master at NTPsec / ntpsec


Commits:
0f5f3de7 by Eric S. Raymond at 2019-02-06T03:09:02Z
In nts_lib.c, use memcpy rather than Linux-only mempcpy.

- - - - -


1 changed file:

- ntpd/nts_lib.c


Changes:

=====================================
ntpd/nts_lib.c
=====================================
@@ -61,11 +61,15 @@ int nts_record_form(record_bits *in) {
 	if (in->critical) {
 		in->now |= htons(0x8000);
 	}
-	in->bit = mempcpy(in->record, &in->now, sizeof(uint16_t));
+	in->bit = in->record;
+	in->bit = memcpy(in->bit, &in->now, sizeof(uint16_t));
+	in->bit += sizeof(uint16_t);
 	in->now = htons(in->body_length);
-	in->bit = mempcpy(in->bit, &in->now, sizeof(uint16_t));
+	memcpy(in->bit, &in->now, sizeof(uint16_t));
+	in->bit += sizeof(uint16_t);
 	if (0 < in->body_length) {
-		in->bit = mempcpy(in->bit, in->body, in->body_length);
+		memcpy(in->bit, in->body, in->body_length);
+		in->bit += in->body_length;
 	}
 	return 0;
 }



View it on GitLab: https://gitlab.com/NTPsec/ntpsec/commit/0f5f3de7ff4da92e07ed1b693b3029f70ea65a1d

-- 
View it on GitLab: https://gitlab.com/NTPsec/ntpsec/commit/0f5f3de7ff4da92e07ed1b693b3029f70ea65a1d
You're receiving this email because of your account on gitlab.com.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ntpsec.org/pipermail/vc/attachments/20190206/d609552b/attachment.html>


More information about the vc mailing list