[v0.88][ARM][BUGFIX] Fix bugs in single CPU SoCs and small bugs related to strings

This commit is contained in:
Dr-Noob
2020-11-24 10:27:33 +01:00
parent 71d660d7b1
commit 685e78f2b7
4 changed files with 6 additions and 7 deletions

View File

@@ -150,12 +150,15 @@ char* get_str_freq(struct frequency* freq) {
uint32_t size = (4+3+1);
assert(strlen(STRING_UNKNOWN)+1 <= size);
char* string = malloc(sizeof(char)*size);
memset(string, 0, sizeof(char)*size);
if(freq->max == UNKNOWN_FREQ)
snprintf(string,strlen(STRING_UNKNOWN)+1,STRING_UNKNOWN);
else if(freq->max >= 1000)
snprintf(string,size,"%.2f"STRING_GIGAHERZ,(float)(freq->max)/1000);
else
snprintf(string,size,"%.2f"STRING_MEGAHERZ,(float)(freq->max));
snprintf(string,size,"%lld"STRING_MEGAHERZ,freq->max);
return string;
}