strings.c: replace copy_spaces, copy_chars with equivalent memset.

This commit is contained in:
Daniel Fairhead
2014-12-10 07:34:59 +00:00
parent b11ada1aba
commit f8e3cfe220
4 changed files with 18 additions and 45 deletions

View File

@@ -287,33 +287,6 @@ char_u *strup_save(const char_u *orig)
return res;
}
/*
* copy a space a number of times
*/
void copy_spaces(char_u *ptr, size_t count)
FUNC_ATTR_NONNULL_ALL
{
size_t i = count;
char_u *p = ptr;
while (i--)
*p++ = ' ';
}
/*
* Copy a character a number of times.
* Does not work for multi-byte characters!
*/
void copy_chars(char_u *ptr, size_t count, char_u c)
FUNC_ATTR_NONNULL_ALL
{
size_t i = count;
char_u *p = ptr;
while (i--)
*p++ = c;
}
/*
* delete spaces at the end of a string
*/