Skip to content

Instantly share code, notes, and snippets.

@eklitzke
Created February 12, 2020 23:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save eklitzke/e63075acc428bcd2e05c18c787bef67e to your computer and use it in GitHub Desktop.
Save eklitzke/e63075acc428bcd2e05c18c787bef67e to your computer and use it in GitHub Desktop.
size_t dirlen = strlen (dir);
char *name = malloc (dirlen + sizeof id_name);
if (unlikely (name == NULL))
break;
memcpy (mempcpy (name, dir, dirlen), id_name, sizeof id_name);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment