mirror of https://github.com/inolen/redream.git
fix for strncpy_trim_spaces when there are no trailing spaces
This commit is contained in:
parent
2f2f5de719
commit
4c0cbcdcc3
|
@ -44,9 +44,9 @@ void strncpy_pad_spaces(char *dst, const char *src, int size) {
|
|||
|
||||
void strncpy_trim_spaces(char *dst, const char *src, int size) {
|
||||
char mask = 0x0;
|
||||
dst += size - 1;
|
||||
src += size - 1;
|
||||
(*dst) = 0;
|
||||
dst += size - 1;
|
||||
*(dst + 1) = 0;
|
||||
while (size--) {
|
||||
/* mask off until a valid letter is hit */
|
||||
if (*src != ' ') {
|
||||
|
|
Loading…
Reference in New Issue