summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLucas Cavalcante de Sousa <lucks.sousa@gmail.com>2020-05-20 09:47:07 -0300
committerFelipe Magno de Almeida <felipe@expertise.dev>2020-12-14 13:45:38 -0300
commit1e22a1b90b2d778e1334e76a93af8efeb63fedfb (patch)
tree7cc30fb2b9be501bcbea1dec47f9c1c427ad6327
parentabcb324c2dedb1107f0fd0298f9a8bb41d6d76d2 (diff)
downloadefl-1e22a1b90b2d778e1334e76a93af8efeb63fedfb.tar.gz
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.
-rw-r--r--src/lib/eina/eina_error.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/lib/eina/eina_error.c b/src/lib/eina/eina_error.c
index 43851728e5..8362aa4531 100644
--- a/src/lib/eina/eina_error.c
+++ b/src/lib/eina/eina_error.c
@@ -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
{