[patch] size optimization for mkswap.c
Tito
farmatito at tiscali.it
Thu Mar 16 14:12:21 UTC 2006
On Thursday 16 March 2006 15:06, Bernhard Fischer wrote:
With USE_FEATURE_MKSWAP_V0 but no error message ;-)
+ bb_opt_complementally = "?"; /* call bb_show_usage internally */
+ sz = bb_getopt_ulflags(argc, argv, "+cfv:", &tmp);
- if (sz & BB_GETOPT_ERROR)
- bb_show_usage();
- version = atoi(tmp);
/* check if value is correct */
+ version = bb_xgetlarg(tmp, 10, (USE_FEATURE_MKSWAP_V0) ? 0 : 1, 1);
/* check if value is correct or call bb_show_usage internally */
+ PAGES = bb_xgetlarg(arv[0], 0, min value?, max value?) / blocks_per_page;
- PAGES = strtol(argv[0], &tmp, 0) / blocks_per_page;
- if (*tmp)
- bb_show_usage();
Just an idea.
Ciao,
TIto
More information about the busybox
mailing list