Felix Zielcke wrote: > But yeah maybe there's even in the kernel a use for asprintf, > so maybe a good idea to make a grub_asprintf? > This could be then either always used even if the util/*.c use the > library functions normally or it could be done as with my > grub_print_error change :)
It would be security feature to use automatic allocation of the memory for needed amount of the memory. Then it is not possible to do buffer overflow with those functions. So I have nothing against that. And in anyway it is only small wrapper to snprintf and malloc so size impact should not be too big either. Perhaps it can save space later on. But about using string formatters from different systems can be problematic. As on some systems differ what different specifiers do. Good examples are cases where string can be wide char or ansi, or where length of the integer can change. When using it with grub's own formatters we know exactly how they perform. _______________________________________________ Grub-devel mailing list Grub-devel@gnu.org http://lists.gnu.org/mailman/listinfo/grub-devel