tech-userlevel archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Making fdisk accept percentages (and modifiers on shell)



Hi,

> >> 4 - documentation does not look right, it's "cyl/mb/gb/tb" (or
> >> "CYL/MB/GB/TB"). "c/m/g/t" are not valid according to the various
> >> strncasecmp() in the code.
> > Because of the 'n' it is - only the length of the modifier of the number
> > is taken, so this works.
> 
> Indeed. Waow, perhaps dehumanize_number(3) was not available at the time 
> fdisk(8) was written.
and now you can't change it without breaking current behaviour (or producing
more code than necessary).

> Minor knits I just noticed ((more for the sake of being clean):
> 
> - meaningful errors when missing an argument in -s
> - check for 'id' validity before converting via strtoll(3)
Ok, thank you!

Btw, something I wondered about before: change_part is given cbootmenu as an
argument, though cbootmenu isn't even defined if BOOTSEL is not selected.
Strange enough, that compiles. Perhaps I'm just too dumb, or the compiler too
smart for me, but imho that should be fixed. Seems... unclean.
I don't know the preferred way to fix it, so I won't do it. The most obvious
way would be to define change_part differently, depending on BOOTSEL, or to
check for the last param being NULL and then defining cbootmenu without
respect to BOOTSEL.


Regards, Julian

Attachment: signature.asc
Description: PGP signature



Home | Main Index | Thread Index | Old Index