Skip to content

Conversation

@alejandro-colomar
Copy link
Collaborator

@alejandro-colomar alejandro-colomar commented Jul 22, 2025

memcpy(3) is overkill, and much more dangerous than simple assignment. Simple assignment adds type safety, and removes any possibility of buffer overflow due to accidentally specifying a wrong size.


Revisions:

v1b
  • Rebase
$ git rd 
1:  06f00620 = 1:  fddf7b83 lib/: Use simple assignment instead of memcpy(3)
v1c
  • Rebase
$ git rd 
1:  fddf7b83 = 1:  1a0d002e lib/: Use simple assignment instead of memcpy(3)
v1d
  • Rebase
$ git rd 
1:  1a0d002e = 1:  61ed51db lib/: Use simple assignment instead of memcpy(3)
v1e
  • Rebase
$ git rd 
1:  61ed51db = 1:  f6df13b2 lib/: Use simple assignment instead of memcpy(3)
v1f
  • Rebase
$ git rd 
1:  f6df13b2 = 1:  0a268c9b lib/: Use simple assignment instead of memcpy(3)

memcpy(3) is overkill, and much more dangerous than simple assignment.
Simple assignment adds type safety, and removes any possibility of
buffer overflow due to accidentally specifying a wrong size.

Signed-off-by: Alejandro Colomar <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant