[v1.06] Replace emalloc+memset with ecalloc when possible. Refactor some memory allocation code

This commit is contained in:
Dr-Noob
2024-08-24 15:32:33 +01:00
parent 025e28c516
commit 40374121b8
10 changed files with 19 additions and 32 deletions

View File

@@ -33,8 +33,7 @@ static char* soc_rpi_string[] = {
char* toupperstr(char* str) {
int len = strlen(str) + 1;
char* ret = emalloc(sizeof(char) * len);
memset(ret, 0, sizeof(char) * len);
char* ret = ecalloc(len, sizeof(char));
for(int i=0; i < len; i++) {
ret[i] = toupper((unsigned char) str[i]);