diff --git a/src/libespeak-ng/mbrowrap.c b/src/libespeak-ng/mbrowrap.c index 84a11312..fe4bf7da 100644 --- a/src/libespeak-ng/mbrowrap.c +++ b/src/libespeak-ng/mbrowrap.c @@ -42,7 +42,6 @@ BOOL load_MBR() read_MBR = (PROCISI)GetProcAddress(hinstDllMBR, "read_MBR"); close_MBR = (PROCVV)GetProcAddress(hinstDllMBR, "close_MBR"); reset_MBR = (PROCVV)GetProcAddress(hinstDllMBR, "reset_MBR"); - lastError_MBR = (PROCIV)GetProcAddress(hinstDllMBR, "lastError_MBR"); lastErrorStr_MBR = (PROCVCI)GetProcAddress(hinstDllMBR, "lastErrorStr_MBR"); setNoError_MBR = (PROCVI)GetProcAddress(hinstDllMBR, "setNoError_MBR"); setVolumeRatio_MBR = (PROCVF)GetProcAddress(hinstDllMBR, "setVolumeRatio_MBR"); @@ -635,13 +634,13 @@ void setVolumeRatio_mbrola(float value) init_MBR(mbr_voice_path); } -int lastErrorStr_mbrola(char *buffer, int bufsize) +char *lastErrorStr_mbrola(char *buffer, int bufsize) { int result; if (mbr_pid) mbrola_has_errors(); result = snprintf(buffer, bufsize, "%s", mbr_errorbuf); - return result >= bufsize ? (bufsize - 1) : result; + return buffer; } void setNoError_mbrola(int no_error) diff --git a/src/libespeak-ng/mbrowrap.h b/src/libespeak-ng/mbrowrap.h index f612a01b..8d9af7c5 100644 --- a/src/libespeak-ng/mbrowrap.h +++ b/src/libespeak-ng/mbrowrap.h @@ -29,7 +29,7 @@ extern "C" typedef void (WINAPI *PROCVV)(void); typedef void (WINAPI *PROCVI)(int); typedef void (WINAPI *PROCVF)(float); -typedef int (WINAPI *PROCIV)(); +typedef int (WINAPI *PROCIV)(void); typedef int (WINAPI *PROCIC)(char *); typedef int (WINAPI *PROCISI)(short *, int); typedef char * (WINAPI *PROCVCI)(char *, int); @@ -99,13 +99,11 @@ void (WINAPI *setVolumeRatio_MBR)(float value); /* * Copy into 'buffer' at most 'bufsize' bytes from the latest error - * message. This may also contain non-fatal errors from mbrola. The - * returned value is the actual number of bytes copied. When no error - * message is pending then an empty string is returned. Consecutive - * calls to lastErrorStr_MBR() will return the same message unless it - * is explicitly cleared with resetError_MBR(). + * message. This may also contain non-fatal errors from mbrola. When + * no error message is pending then an empty string is returned. + * Consecutive calls to lastErrorStr_MBR() will return the same message. */ -int (WINAPI *lastErrorStr_MBR)(char *buffer, int bufsize); +char * (WINAPI *lastErrorStr_MBR)(char *buffer, int bufsize); /* * Tolerance to missing diphones.