indent: avoid calling write(2) with a negative second parameter.

negative_returns: n is passed to a parameter that cannot be negative.
Fix a style issue while here.

CID:	1008107
This commit is contained in:
Pedro F. Giffuni 2016-07-28 16:54:12 +00:00
parent 938809f941
commit 0504bd6580
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=303452

View File

@ -1213,7 +1213,7 @@ bakcopy(void)
bakchn = creat(bakfile, 0600);
if (bakchn < 0)
err(1, "%s", bakfile);
while ((n = read(fileno(input), buff, sizeof buff)) != 0)
while ((n = read(fileno(input), buff, sizeof(buff))) > 0)
if (write(bakchn, buff, n) != n)
err(1, "%s", bakfile);
if (n < 0)