1
0
Fork 0
mirror of git://git.code.sf.net/p/zsh/code synced 2025-10-28 17:10:59 +01:00

39871: cut down number of strlen()s in getstrvalue()

This commit is contained in:
Sebastian Gniazdowski 2016-11-08 05:37:53 -08:00 committed by Peter Stephenson
parent a57977d01a
commit 06e4ec853a
3 changed files with 32 additions and 6 deletions

View file

@ -41,6 +41,19 @@ dupstring(const char *s)
return t;
}
/**/
mod_export char *
dupstring_wlen(const char *s, unsigned len)
{
char *t;
if (!s)
return NULL;
t = (char *) zhalloc(len + 1);
strcpy(t, s);
return t;
}
/**/
mod_export char *
ztrdup(const char *s)