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:
parent
a57977d01a
commit
06e4ec853a
3 changed files with 32 additions and 6 deletions
13
Src/string.c
13
Src/string.c
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue