1
0
Fork 0
mirror of git://git.code.sf.net/p/zsh/code synced 2025-09-14 14:01:18 +02:00

29107: replace overlapping strcpy with memmove

This commit is contained in:
Bart Schaefer 2011-04-29 15:23:33 +00:00
parent 6a69eb2978
commit 2938c58c82
2 changed files with 10 additions and 5 deletions

View file

@ -1,3 +1,8 @@
2011-04-29 Barton E. Schaefer <schaefer@zsh.org>
* 29107: Src/Zle/zle_tricky.c: replace overlapping strcpy with
memmove.
2011-04-27 Mikael Magnusson <mikachu@gmail.com>
* 29051: Completion/Unix/Command/_make: add _make- prefix to
@ -14529,5 +14534,5 @@
*****************************************************
* This is used by the shell to define $ZSH_PATCHLEVEL
* $Revision: 1.5265 $
* $Revision: 1.5266 $
*****************************************************

View file

@ -1899,7 +1899,7 @@ get_comp_string(void)
*dbeg = '{';
i -= len;
boffs -= len;
strcpy(dbeg, dbeg + len);
memmove(dbeg, dbeg + len, 1+strlen(dbeg+len));
dp -= len;
}
bbeg = lastp = p;
@ -1948,7 +1948,7 @@ get_comp_string(void)
*dbeg = '{';
i -= len;
boffs -= len;
strcpy(dbeg, dbeg + len);
memmove(dbeg, dbeg + len, 1+strlen(dbeg+len));
dp -= len;
}
bbeg = NULL;
@ -2013,7 +2013,7 @@ get_comp_string(void)
new->qpos = strlen(quotename(predup, NULL));
*dbeg = '{';
boffs -= len;
strcpy(dbeg, dbeg + len);
memmove(dbeg, dbeg + len, 1+strlen(dbeg+len));
}
if (brend) {
Brinfo bp, prev = NULL;
@ -2026,7 +2026,7 @@ get_comp_string(void)
l = bp->qpos;
bp->pos = strlen(predup + p + l);
bp->qpos = strlen(quotename(predup + p + l, NULL));
strcpy(predup + p, predup + p + l);
memmove(predup + p, predup + p + l, 1+bp->pos);
}
}
if (hascom) {