diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2009-10-08 03:06:04 +0200 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2009-10-08 03:06:04 +0200 |
commit | 4ac9819263114edb9b5b638ffa6d2e41a4bb46e7 (patch) | |
tree | f0c5bc9c7a2bf3a384b85350bfe4c9ca5ec4858f /coreutils | |
parent | 5b807cd5acd1f27b3e7aa36aac2728be27c5907c (diff) | |
download | busybox-w32-4ac9819263114edb9b5b638ffa6d2e41a4bb46e7.tar.gz busybox-w32-4ac9819263114edb9b5b638ffa6d2e41a4bb46e7.tar.bz2 busybox-w32-4ac9819263114edb9b5b638ffa6d2e41a4bb46e7.zip |
apply post-1.15.1 fixes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'coreutils')
-rw-r--r-- | coreutils/dd.c | 11 | ||||
-rw-r--r-- | coreutils/uniq.c | 1 |
2 files changed, 7 insertions, 5 deletions
diff --git a/coreutils/dd.c b/coreutils/dd.c index 5281d8118..381f60075 100644 --- a/coreutils/dd.c +++ b/coreutils/dd.c | |||
@@ -286,25 +286,26 @@ int dd_main(int argc UNUSED_PARAM, char **argv) | |||
286 | } | 286 | } |
287 | 287 | ||
288 | while (!(flags & FLAG_COUNT) || (G.in_full + G.in_part != count)) { | 288 | while (!(flags & FLAG_COUNT) || (G.in_full + G.in_part != count)) { |
289 | if (flags & FLAG_NOERROR) /* Pre-zero the buffer if conv=noerror */ | ||
290 | memset(ibuf, 0, ibs); | ||
291 | n = safe_read(ifd, ibuf, ibs); | 289 | n = safe_read(ifd, ibuf, ibs); |
292 | if (n == 0) | 290 | if (n == 0) |
293 | break; | 291 | break; |
294 | if (n < 0) { | 292 | if (n < 0) { |
293 | /* "Bad block" */ | ||
295 | if (!(flags & FLAG_NOERROR)) | 294 | if (!(flags & FLAG_NOERROR)) |
296 | goto die_infile; | 295 | goto die_infile; |
297 | n = ibs; | ||
298 | bb_simple_perror_msg(infile); | 296 | bb_simple_perror_msg(infile); |
299 | /* GNU dd with conv=noerror skips over "bad blocks" */ | 297 | /* GNU dd with conv=noerror skips over bad blocks */ |
300 | xlseek(ifd, ibs, SEEK_CUR); | 298 | xlseek(ifd, ibs, SEEK_CUR); |
299 | /* conv=noerror,sync writes NULs, | ||
300 | * conv=noerror just ignores input bad blocks */ | ||
301 | n = 0; | ||
301 | } | 302 | } |
302 | if ((size_t)n == ibs) | 303 | if ((size_t)n == ibs) |
303 | G.in_full++; | 304 | G.in_full++; |
304 | else { | 305 | else { |
305 | G.in_part++; | 306 | G.in_part++; |
306 | if (flags & FLAG_SYNC) { | 307 | if (flags & FLAG_SYNC) { |
307 | memset(ibuf + n, '\0', ibs - n); | 308 | memset(ibuf + n, 0, ibs - n); |
308 | n = ibs; | 309 | n = ibs; |
309 | } | 310 | } |
310 | } | 311 | } |
diff --git a/coreutils/uniq.c b/coreutils/uniq.c index 126eaeef9..e703659c6 100644 --- a/coreutils/uniq.c +++ b/coreutils/uniq.c | |||
@@ -84,6 +84,7 @@ int uniq_main(int argc UNUSED_PARAM, char **argv) | |||
84 | break; | 84 | break; |
85 | } | 85 | } |
86 | 86 | ||
87 | free((char*)s1); | ||
87 | ++dups; /* note: testing for overflow seems excessive. */ | 88 | ++dups; /* note: testing for overflow seems excessive. */ |
88 | } | 89 | } |
89 | 90 | ||