eina: Resolve string comparison from strerror_s when no code is returned

On Windows, `strerror_s` doesn't return the error code with the error
message string as `strerror_r` on Linux does. So we do not compare the
last space before the error code, comparing 13 characters instead of
14. Thus comparing for "Unknown error" correctly for all platforms.
This commit is contained in:
Lucas Cavalcante de Sousa 2020-05-20 09:47:07 -03:00 committed by Felipe Magno de Almeida
parent abcb324c2d
commit 1e22a1b90b
1 changed files with 1 additions and 1 deletions

View File

@ -355,7 +355,7 @@ eina_error_msg_get(Eina_Error error)
EINA_SAFETY_ERROR("strerror_r() failed");
else
{
if (strncmp(str, unknown_prefix, sizeof(unknown_prefix) -1) == 0)
if (strncmp(str, unknown_prefix, sizeof(unknown_prefix) - 2) == 0)
msg = NULL;
else
{