mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-08-20 21:33:47 -07:00
chg: use calloc
This commit is contained in:
parent
e81b0fa355
commit
99b6087b01
7 changed files with 9 additions and 9 deletions
|
@ -884,8 +884,8 @@ extern void strcreplace(char *buf, size_t len, char from, char to) {
|
|||
}
|
||||
|
||||
extern char *strmcopy(char *buf) {
|
||||
char* str = NULL;
|
||||
if ((str = (char*) malloc(strlen(buf) + 1)) != NULL) {
|
||||
char* str = (char*) calloc(strlen(buf) + 1, sizeof(uint8_t));
|
||||
if (str != NULL) {
|
||||
memset(str, 0, strlen(buf) + 1);
|
||||
strcpy(str, buf);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue