diff options
author | kevlo <kevlo@FreeBSD.org> | 2007-11-06 10:35:50 +0000 |
---|---|---|
committer | kevlo <kevlo@FreeBSD.org> | 2007-11-06 10:35:50 +0000 |
commit | 80e691eb7fe6da094ac1cc2f552ad92046f1a847 (patch) | |
tree | ca44a109000fbf4a04b479623e540b9b145d4021 /usr.bin/du | |
parent | 45cc59ef4fed7a576c50eedd3a9202e5a65a68f0 (diff) | |
download | FreeBSD-src-80e691eb7fe6da094ac1cc2f552ad92046f1a847.zip FreeBSD-src-80e691eb7fe6da094ac1cc2f552ad92046f1a847.tar.gz |
Check return value for setenv()
Diffstat (limited to 'usr.bin/du')
-rw-r--r-- | usr.bin/du/du.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/usr.bin/du/du.c b/usr.bin/du/du.c index 73583e3..17da719 100644 --- a/usr.bin/du/du.c +++ b/usr.bin/du/du.c @@ -140,16 +140,20 @@ main(int argc, char *argv[]) cflag = 1; break; case 'h': - setenv("BLOCKSIZE", "512", 1); + if (setenv("BLOCKSIZE", "512", 1) == -1) + warnx( + "setenv: cannot set BLOCKSIZE=512"); hflag = 1; break; case 'k': hflag = 0; - setenv("BLOCKSIZE", "1024", 1); + if (setenv("BLOCKSIZE", "1024", 1) == -1) + warnx("setenv: cannot set BLOCKSIZE=1024"); break; case 'm': hflag = 0; - setenv("BLOCKSIZE", "1048576", 1); + if (setenv("BLOCKSIZE", "1048576", 1) == -1) + warnx("setenv: cannot set BLOCKSIZE=1048576"); break; case 'n': nodumpflag = 1; |