cr-service: fix gcc-8 error
The latest patches to cr-service.c broke compilation with gcc-8: criu/cr-service.c: In function ‘setup_opts_from_req’: criu/cr-service.c:323:3: error: ‘strncpy’ specified bound 4096 equals destination size [-Werror=stringop-truncation] strncpy(images_dir_path, opts.imgs_dir, PATH_MAX); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ criu/cr-service.c:343:3: error: ‘strncpy’ specified bound 4096 equals destination size [-Werror=stringop-truncation] strncpy(work_dir_path, opts.work_dir, PATH_MAX); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ cc1: all warnings being treated as errors This fixes the errors by specifying the strncpy() size as 'PATH_MAX - 1'. Signed-off-by:Adrian Reber <areber@redhat.com> Signed-off-by:
Andrei Vagin <avagin@virtuozzo.com>
Showing
Please
register
or
sign in
to comment