]> git.ipfire.org Git - thirdparty/util-linux.git/commit
prlimit: fix compiler warning [-Wmaybe-uninitialized]
authorKarel Zak <kzak@redhat.com>
Mon, 9 Aug 2021 07:45:21 +0000 (09:45 +0200)
committerKarel Zak <kzak@redhat.com>
Mon, 9 Aug 2021 09:54:07 +0000 (11:54 +0200)
commitf6dd7b20cdcb5b6a8aae4877024026f1eefaea73
tree74d39b75c14206f646788775585d27ebcecf690f
parentebd4749115cc12cf91ce1958bd030d70c8b1994e
prlimit: fix compiler warning [-Wmaybe-uninitialized]

sys-utils/prlimit.c:467:16: warning: 'hard' may be used uninitialized in this function [-Wmaybe-uninitialized]
  lim->rlim_max = hard;
  ~~~~~~~~~~~~~~^~~~~~
sys-utils/prlimit.c:456:15: note: 'hard' was declared here
  rlim_t soft, hard;
               ^~~~
sys-utils/prlimit.c:466:16: warning: 'soft' may be used uninitialized in this function [-Wmaybe-uninitialized]
  lim->rlim_cur = soft;
  ~~~~~~~~~~~~~~^~~~~~
sys-utils/prlimit.c:456:9: note: 'soft' was declared here
  rlim_t soft, hard;
         ^~~~

References: https://github.com/karelzak/util-linux/issues/1406
Signed-off-by: Karel Zak <kzak@redhat.com>
sys-utils/prlimit.c