Last active
August 29, 2015 14:13
-
-
Save awsong/a90896df42990cd13773 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int catvars(char *buf1, char *buf2, unsigned int len1, | |
unsigned int len2){ | |
char mybuf[256]; | |
if((len1 + len2) > 256){ /* [3] */ | |
return -1; | |
} | |
memcpy(mybuf, buf1, len1); /* [4] */ | |
memcpy(mybuf + len1, buf2, len2); | |
do_some_stuff(mybuf); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment