lkml.org 
[lkml]   [2006]   [May]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [RFC PATCH 33/35] Add the Xenbus sysfs and virtual device hotplug driver.
> +/* Simplified asprintf. */
> +char *kasprintf(const char *fmt, ...)
> +{
> + va_list ap;
> + unsigned int len;
> + char *p, dummy[1];
> +
> + va_start(ap, fmt);
> + /* FIXME: vsnprintf has a bug, NULL should work */
> + len = vsnprintf(dummy, 0, fmt, ap);
> + va_end(ap);
> +
> + p = kmalloc(len + 1, GFP_KERNEL);
> + if (!p)
> + return NULL;
> + va_start(ap, fmt);
> + vsprintf(p, fmt, ap);
> + va_end(ap);
> + return p;
> +}

This should go to lib/

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2006-05-09 18:11    [W:0.706 / U:0.104 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site