char *kstrdup(
const char *istr)
none
none
char *str = kstrdup("this sentence needs a capital t at the start.");
if (str == NULL)
{
kerror(NULL, NULL, "Cannot malloc space for the string");
return;
}
str[0] = 'T';
kprintf("%s\n", str);
The resulting print will be 'This sentence needs a capital t at the start.'
$BOOTSTRAP/objects/library/kutils/src/strings.c