mirror of
https://github.com/Dr-Noob/cpufetch.git
synced 2026-03-25 07:50:40 +01:00
[v1.06] Replace emalloc+memset with ecalloc when possible. Refactor some memory allocation code
This commit is contained in:
@@ -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]);
|
||||
|
||||
Reference in New Issue
Block a user