2
0
mirror of https://github.com/checkpoint-restore/criu synced 2025-08-30 13:58:34 +00:00

criu: fix configuration file scanner with GCC 12

This fixes:

criu/config.c: In function ‘parse_statement’:
criu/config.c:232:43: error: the comparison will always evaluate as ‘true’ for the pointer operand in ‘*(configuration + (sizetype)((long unsigned int)i * 8)) + ((sizetype)offset + 1)’ must not be NULL [-Werror=address]
  232 |         if (configuration[i] + offset + 1 != 0 && strchr(configuration[i] + offset, ' ')) {
      |                                           ^~

Signed-off-by: Adrian Reber <areber@redhat.com>
This commit is contained in:
Adrian Reber
2022-01-18 17:20:35 +00:00
committed by Andrei Vagin
parent bf6975c3e5
commit db352ca488

View File

@@ -229,7 +229,7 @@ out:
tmp_string[0] = 0;
/* Check for unsupported configuration file entries */
if (configuration[i] + offset + 1 != 0 && strchr(configuration[i] + offset, ' ')) {
if (strchr(configuration[i] + offset, ' ')) {
int j;
len = strlen(configuration[i] + offset);
for (j = 0; j < len - 1; j++) {