From 5b7c251f567818c15c4ef782c22e955d055b6c11 Mon Sep 17 00:00:00 2001 From: Adam Heath Date: Wed, 27 Dec 2000 10:01:33 +0000 Subject: [PATCH] Added nfstrnsave(). --- ChangeLog | 4 ++++ lib/nfmalloc.c | 8 ++++++++ 2 files changed, 12 insertions(+) diff --git a/ChangeLog b/ChangeLog index 5f1fe675..52db36bc 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +Wed Dec 27 04:00:32 CST 2000 Adam Heath + + * lib/nfmalloc.c: Added nfstrnsave(). + Tue Dec 26 17:07:11 CST 2000 Adam Heath * lib/md5.c, lib/md5.h: Oops, forgot to add these files. diff --git a/lib/nfmalloc.c b/lib/nfmalloc.c index c2ba7e7f..04d16adb 100644 --- a/lib/nfmalloc.c +++ b/lib/nfmalloc.c @@ -89,3 +89,11 @@ char *nfstrsave(const char *string) { strcpy(r,string); return r; } + +char *nfstrnsave(const char *string, int l) { + char *r; + + r= nfmalloc(l+1); + strncpy(r,string,l); + return r; +} -- 2.39.5