- opt_buffersize= strtoul(arg,&ep,0);
- if (opt_buffersize > RWBUFFER_SIZE_MB_MAX)
+ buffersize= strtoul(arg,&ep,0);
+ if (ep[0] && ep[1]) usageerr("buffer size spec. invalid");
+ switch (ep[0]) {
+ case 0: case 'm': shift= 20; break;
+ case 'k': shift= 10; break;
+ case 'b': shift= 0; break;
+ default: usageerr("buffer size unit unknown");
+ }
+ if (buffersize > ((RWBUFFER_SIZE_MB_MAX << 20) >> shift))