LoadSoundFile: Fix char signedness

This commit is contained in:
Samuel Thibault
2022-04-08 01:24:50 +02:00
parent 2c524ec8df
commit c91aa78363
+3 -3
View File
@@ -48,7 +48,7 @@ SOUND_ICON soundicon_tab[N_SOUNDICON_TAB];
static espeak_ng_STATUS LoadSoundFile(const char *fname, int index, espeak_ng_ERROR_CONTEXT *context)
{
FILE *f;
char *p;
unsigned char *p;
int length;
char fname_temp[100];
char fname2[sizeof(path_home)+13+40];
@@ -120,7 +120,7 @@ static espeak_ng_STATUS LoadSoundFile(const char *fname, int index, espeak_ng_ER
fclose(f);
return create_file_error_context(context, error, fname);
}
if ((p = (char *)realloc(soundicon_tab[index].data, length)) == NULL) {
if ((p = realloc(soundicon_tab[index].data, length)) == NULL) {
fclose(f);
return ENOMEM;
}
@@ -138,7 +138,7 @@ static espeak_ng_STATUS LoadSoundFile(const char *fname, int index, espeak_ng_ER
length = p[40] | (p[41] << 8) | (p[42] << 16) | (p[43] << 24);
soundicon_tab[index].length = length / 2; // length in samples
soundicon_tab[index].data = p;
soundicon_tab[index].data = (char *) p;
return ENS_OK;
}