context: fix a compiler warning
authorPeter Hutterer <peter.hutterer@who-t.net>
Mon, 7 Sep 2020 09:47:42 +0000 (19:47 +1000)
committerRan Benita <ran@unusedvar.com>
Mon, 7 Sep 2020 19:01:57 +0000 (22:01 +0300)
../src/context.c:57:9: warning: variable 'err' is used uninitialized whenever
'if' condition is true [-Wsometimes-uninitialized]

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
src/context.c

index 2abaa9b..4a6ac8e 100644 (file)
@@ -50,7 +50,7 @@ XKB_EXPORT int
 xkb_context_include_path_append(struct xkb_context *ctx, const char *path)
 {
     struct stat stat_buf;
-    int err;
+    int err = ENOMEM;
     char *tmp;
 
     tmp = strdup(path);