badblocks.c (pattern_fill): Fix bug accidentally added when

fixing up gcc -Wall nits.  badblocks -t random was not
	getting handled properly because ~0 needed to be cast to
	an unsigned long instead of an unsigned char.  (Addresses
	Debian bug #234828)
bitmap-optimize
Theodore Ts'o 2004-02-26 21:06:58 -05:00
parent 87a6e45233
commit 023cbb3029
2 changed files with 9 additions and 1 deletions

View File

@ -1,3 +1,11 @@
2004-02-26 Theodore Ts'o <tytso@mit.edu>
* badblocks.c (pattern_fill): Fix bug accidentally added when
fixing up gcc -Wall nits. badblocks -t random was not
getting handled properly because ~0 needed to be cast to
an unsigned long instead of an unsigned char. (Addresses
Debian bug #234828)
2004-02-21 Theodore Ts'o <tytso@mit.edu>
* fsck.c (execute): Use '&&' instead of '&'. (It didn't cause a

View File

@ -219,7 +219,7 @@ static void pattern_fill(unsigned char *buffer, unsigned long pattern,
unsigned int i, nb;
unsigned char bpattern[sizeof(pattern)], *ptr;
if (pattern == (unsigned char) ~0) {
if (pattern == (unsigned long) ~0) {
for (ptr = buffer; ptr < buffer + n; ptr++) {
(*ptr) = random() % (1 << (8 * sizeof(char)));
}