X-Git-Url: http://pilppa.org/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2Fbitmap.c;h=2c9242e3fed01ca348b4171db2c0d89333fa357e;hb=a973e9dd1e140a65bed694a2c5c8d53e9cba1a23;hp=26ebafa8c41d7e0ff602c0d2137a8ea284bb1ae5;hpb=9f6632d6290785caf9e9f874c0a0cfaf2c178e59;p=linux-2.6-omap-h63xx.git diff --git a/lib/bitmap.c b/lib/bitmap.c index 26ebafa8c41..2c9242e3fed 100644 --- a/lib/bitmap.c +++ b/lib/bitmap.c @@ -469,6 +469,10 @@ int bitmap_scnlistprintf(char *buf, unsigned int buflen, /* current bit is 'cur', most recently seen range is [rbot, rtop] */ int cur, rbot, rtop; + if (buflen == 0) + return 0; + buf[0] = 0; + rbot = cur = find_first_bit(maskp, nmaskbits); while (cur < nmaskbits) { rtop = cur;