diff --git a/src/libespeak-ng/error.c b/src/libespeak-ng/error.c index 8d82ba71..1e8eb9ef 100644 --- a/src/libespeak-ng/error.c +++ b/src/libespeak-ng/error.c @@ -128,13 +128,8 @@ ESPEAK_NG_API void espeak_ng_GetStatusCodeMessage(espeak_ng_STATUS status, char #else strerror_r(status, buffer, length); #endif - } else { -#ifdef PLATFORM_WINDOWS - sprintf(buffer, "Unspecified error 0x%x", status); -#else + } else snprintf(buffer, length, "Unspecified error 0x%x", status); -#endif - } break; } } diff --git a/src/libespeak-ng/translate.c b/src/libespeak-ng/translate.c index 5ed23133..9f37bc61 100644 --- a/src/libespeak-ng/translate.c +++ b/src/libespeak-ng/translate.c @@ -80,11 +80,7 @@ int pre_pause; ALPHABET *current_alphabet; // these were previously in translator class -#ifdef PLATFORM_WINDOWS -char word_phonemes[N_WORD_PHONEMES*2]; // longer, because snprint() is not available -#else char word_phonemes[N_WORD_PHONEMES]; // a word translated into phoneme codes -#endif int n_ph_list2; PHONEME_LIST2 ph_list2[N_PHONEME_LIST]; // first stage of text->phonemes @@ -1303,30 +1299,18 @@ int TranslateWord(Translator *tr, char *word_start, WORD_TAB *wtab, char *word_o *p = phonSTRESS_3; } } -#ifdef PLATFORM_WINDOWS - sprintf(word_phonemes, "%s%s%s", unpron_phonemes, prefix_phonemes, phonemes); -#else snprintf(word_phonemes, sizeof(word_phonemes), "%s%s%s", unpron_phonemes, prefix_phonemes, phonemes); -#endif word_phonemes[N_WORD_PHONEMES-1] = 0; SetWordStress(tr, word_phonemes, dictionary_flags, -1, 0); } else { // stress position affects the whole word, including prefix -#ifdef PLATFORM_WINDOWS - sprintf(word_phonemes, "%s%s%s", unpron_phonemes, prefix_phonemes, phonemes); -#else snprintf(word_phonemes, sizeof(word_phonemes), "%s%s%s", unpron_phonemes, prefix_phonemes, phonemes); -#endif word_phonemes[N_WORD_PHONEMES-1] = 0; SetWordStress(tr, word_phonemes, dictionary_flags, -1, 0); } } else { SetWordStress(tr, phonemes, dictionary_flags, -1, add_suffix_phonemes); -#ifdef PLATFORM_WINDOWS - sprintf(word_phonemes, "%s%s%s", unpron_phonemes, prefix_phonemes, phonemes); -#else snprintf(word_phonemes, sizeof(word_phonemes), "%s%s%s", unpron_phonemes, prefix_phonemes, phonemes); -#endif word_phonemes[N_WORD_PHONEMES-1] = 0; }