From 94ace09b40ec881bdeb9a62af03e984e6f15c54b Mon Sep 17 00:00:00 2001 From: "Reece H. Dunn" Date: Fri, 6 Sep 2013 09:22:30 +0100 Subject: [PATCH 1/2] configure.ac: Improve the checks to ensure that portaudio.h and -lportaudio refer to the same version of PortAudio. --- configure.ac | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/configure.ac b/configure.ac index 2d081b33..73441b0f 100644 --- a/configure.ac +++ b/configure.ac @@ -58,11 +58,19 @@ if test "$with_portaudio" = "no"; then else AC_CHECK_HEADERS([portaudio.h], [ - AC_CHECK_LIB([portaudio], [Pa_IsStreamActive], + # Check the portaudio library. + AC_CHECK_LIB([portaudio], [Pa_IsStreamActive]) # portaudio 19 + AC_CHECK_LIB([portaudio], [Pa_StreamActive]) # portaudio 18 + + # Then use the headers to determine the portaudio version. + # This is because on some systems with both libportaudio0 and + # libportaudio2 installed, portaudio.h and -lportaudio refer + # to different versions. + AC_CHECK_FUNC([Pa_IsStreamActive], [ have_portaudio=19 ],[ - AC_CHECK_LIB([portaudio], [Pa_StreamActive], + AC_CHECK_FUNC([Pa_StreamActive], [ have_portaudio=18 ],[ From c1196192e5950a80d37073135780441cc782c127 Mon Sep 17 00:00:00 2001 From: "Reece H. Dunn" Date: Sat, 7 Sep 2013 12:45:22 +0100 Subject: [PATCH 2/2] speak_lib.cpp: Do not crash if espeak_SetPunctuationList is called with a NULL punctuation list. --- src/speak_lib.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/speak_lib.cpp b/src/speak_lib.cpp index dfbbd687..4e609411 100644 --- a/src/speak_lib.cpp +++ b/src/speak_lib.cpp @@ -1,6 +1,7 @@ /*************************************************************************** * Copyright (C) 2005 to 2013 by Jonathan Duddington * * email: jonsd@users.sourceforge.net * + * Copyright (C) 2013 Reece H. Dunn * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * @@ -723,7 +724,7 @@ void sync_espeak_SetPunctuationList(const wchar_t *punctlist) my_unique_identifier = 0; my_user_data = NULL; - wcsncpy(option_punctlist, punctlist, N_PUNCTLIST); + wcsncpy(option_punctlist, punctlist ? punctlist : L"", N_PUNCTLIST); option_punctlist[N_PUNCTLIST-1] = 0; } // end of sync_espeak_SetPunctuationList