From: Jim Meyering Date: Wed, 9 Apr 2003 14:40:05 +0000 (+0000) Subject: (bytes_split): Use size_t temporary (rather than X-Git-Tag: v5.0.1~780 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=78d8a32a1af7686d1a035f81181f632b5b7defae;p=thirdparty%2Fcoreutils.git (bytes_split): Use size_t temporary (rather than uintmax_t original) in remaining computations. From Paul Eggert. --- diff --git a/src/split.c b/src/split.c index 3fc346c1be..261fd23ce6 100644 --- a/src/split.c +++ b/src/split.c @@ -218,7 +218,6 @@ bytes_split (uintmax_t n_bytes, char *buf, size_t bufsize) to_read = n_read; for (;;) { - size_t last_bufsize; if (to_read < to_write) { if (to_read) /* do not write 0 bytes! */ @@ -229,13 +228,15 @@ bytes_split (uintmax_t n_bytes, char *buf, size_t bufsize) } break; } - - last_bufsize = to_write; - cwrite (new_file_flag, bp_out, last_bufsize); - bp_out += to_write; - to_read -= to_write; - new_file_flag = 1; - to_write = n_bytes; + else + { + size_t w = to_write; + cwrite (new_file_flag, bp_out, w); + bp_out += w; + to_read -= w; + new_file_flag = 1; + to_write = n_bytes; + } } } while (n_read == bufsize);