* parno stored within struct fdisk_partition) */
/* remove all */
- fdisk_reset_iter(itr, FDISK_ITER_FORWARD);
- while (fdisk_table_next_partition(tb, itr, &pa) == 0)
- fdisk_table_remove_partition(tb, pa);
+ fdisk_reset_table(tb);
s_itr = scols_new_iter(SCOLS_ITER_FORWARD);
if (!s_itr)
if (!ui_enabled)
return -EINVAL;
- strsz = size_to_human_string(SIZE_SUFFIX_SPACE
+ strsz = size_to_human_string(SIZE_DECIMAL_2DIGITS
+ | SIZE_SUFFIX_SPACE
| SIZE_SUFFIX_3LETTER, bytes);
lb = fdisk_get_label(cf->cxt, NULL);
clrtoeol();
if (prompt) {
- mvaddstr(ln, cl, (char *) prompt);
+ mvaddstr(ln, cl, prompt);
cl += mbs_safe_width(prompt);
}
ssize_t rc;
char *dflt = size_to_human_string(0, *res);
- DBG(UI, ul_debug("get_size (default=%ju)", *res));
+ DBG(UI, ul_debug("get_size (default=%"PRIu64")", *res));
ui_clean_info();
insec = 1;
buf[len - 1] = '\0';
}
- rc = parse_size(buf, &user, &pwr); /* parse */
+ rc = parse_size(buf, (uintmax_t *)&user, &pwr); /* parse */
}
if (rc == 0) {
setlocale(LC_ALL, "");
bindtextdomain(PACKAGE, LOCALEDIR);
textdomain(PACKAGE);
- atexit(close_stdout);
+ close_stdout_atexit();
while((c = getopt_long(argc, argv, "L::hVz", longopts, NULL)) != -1) {
switch(c) {
_("unsupported color mode"));
break;
case 'V':
- printf(UTIL_LINUX_VERSION);
- return EXIT_SUCCESS;
+ print_version(EXIT_SUCCESS);
case 'z':
cf->zero_start = 1;
break;
cfdisk_free_lines(cf);
free(cf->linesbuf);
+ free(cf->fields);
fdisk_unref_table(cf->table);
#ifdef HAVE_LIBMOUNT