From c91aa78363103f43fa8d48e3106468644e2686d9 Mon Sep 17 00:00:00 2001 From: Samuel Thibault Date: Fri, 8 Apr 2022 01:24:50 +0200 Subject: [PATCH] LoadSoundFile: Fix char signedness --- src/libespeak-ng/soundicon.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/libespeak-ng/soundicon.c b/src/libespeak-ng/soundicon.c index 298c68bc..8b350045 100644 --- a/src/libespeak-ng/soundicon.c +++ b/src/libespeak-ng/soundicon.c @@ -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; }