[HUST CSE] add forced type conversion when using 'realloc','malloc','calloc' for better readability

This commit is contained in:
zouziyu2002
2023-04-28 22:55:28 +08:00
committed by GitHub
parent 085ded8eef
commit ce4674defa
8 changed files with 16 additions and 13 deletions

View File

@@ -58,7 +58,7 @@ char * str_accumulate(const char * s)
accu = (char *) pthread_getspecific(str_key);
/* It's initially NULL, meaning that we must allocate the buffer first. */
if (accu == NULL) {
accu = malloc(1024);
accu = (char *)malloc(1024);
if (accu == NULL) return NULL;
accu[0] = 0;
/* Store the buffer pointer in the thread-specific data. */