Fix the following clang warnings by reducing the scan size from 4096 to
4095 so that there is room for the null character.
api.c:5173:52: warning: 'fscanf' may overflow; destination buffer in
argument 4 has size 4096, but the corresponding specifier may require
size 4097 [-Wfortify-source]
5173 | ret = fscanf(pid_cgrp_fd,
"%d::%4096s\n", &num, cgrp_path);
|
^
api.c:5218:69: warning: 'fscanf' may overflow; destination buffer in
argument 5 has size 4096, but the corresponding specifier may require
size 4097 [-Wfortify-source]
5218 | ret = fscanf(pid_cgrp_fd, "%d:%[^:]:%4096s\n",
&num, controllers, cgrp_path);
|
^
Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com> Signed-off-by: Kamalesh Babulal <kamalesh.babulal@oracle.com>