Skip to content

Commit

Permalink
compose/paths: fix false <-> NULL confusion, errors on C23
Browse files Browse the repository at this point in the history
i don't have access to github but this patch enabled me to compile
libxkbcommon with -std=gnu23

otherwise the following compilation error will result :

    ../src/compose/paths.c:70:16: error: incompatible types when returning type ‘_Bool’ but ‘char *’ was expected

( gcc (GCC) 15.0.0 20240509 (experimental) )

Signed-off-by: Ran Benita <[email protected]>
  • Loading branch information
Jeffrey Cliff authored and bluetech committed Nov 23, 2024
1 parent 15da5ee commit b1b9ff6
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/compose/paths.c
Original file line number Diff line number Diff line change
Expand Up @@ -68,16 +68,16 @@ resolve_name(struct xkb_context *ctx, const char *filename,

ret = snprintf(path, sizeof(path), "%s/%s", xlocaledir, filename);
if (ret < 0 || (size_t) ret >= sizeof(path))
return false;
return NULL;

file = fopen(path, "rb");
if (!file)
return false;
return NULL;

ok = map_file(file, &string, &string_size);
fclose(file);
if (!ok)
return false;
return NULL;

s = string;
end = string + string_size;
Expand Down

0 comments on commit b1b9ff6

Please sign in to comment.