On Sat, May 12, 2001 at 02:10:45AM -0400, Daniel Hemmerich wrote:
> Any comments, suggestions, swears concerning adding a new function,
> strndup(), to libc?
>
> So that instead of permitting it to attempt to allocate a large chunk of
> memory, it is possible to give it a max length.
#include <stdio.h>
int main(int argc, char **argv) {
char *p;
asprintf(&p, "%.*s", 100, argv[1]);
printf("%s %d\n", p, strlen(p));
}
Kris
- adding a new function to libc Daniel Hemmerich
- Re: adding a new function to libc Peter Seebach
- Re: adding a new function to libc Terry Lambert
- Re: adding a new function to libc Valentin Nechayev
- Re: adding a new function to libc Peter Pentchev
- Re: adding a new function to libc Valentin Nechayev
- Re: adding a new function to libc Assar Westerlund
- Re: adding a new function to libc Bakul Shah
- Re: adding a new function to libc Kris Kennaway
- Re: adding a new function to libc Terry Lambert
PGP signature
