mirror of
https://github.com/fachat/xa65.git
synced 2025-01-14 05:31:52 +00:00
apply rest of pull request #8
This commit is contained in:
parent
b5cda1bd88
commit
485a7ec1a5
17
xa/src/xap.c
17
xa/src/xap.c
@ -644,7 +644,7 @@ static int pp_replace_part(char *to, char *t, int n, int sl, int recursive,
|
||||
#endif
|
||||
}
|
||||
/* if(flag) printf("sl=%d,",sl);*/
|
||||
sl = (int) ((long) y + 1L - (long) t);
|
||||
sl = (int) (y + 1 - t);
|
||||
/* if(flag) printf("sl=%d\n",sl);*/
|
||||
rs = fto;
|
||||
#ifdef DEBUG_RECMAC
|
||||
@ -665,21 +665,8 @@ static int pp_replace_part(char *to, char *t, int n, int sl, int recursive,
|
||||
return (E_NOMEM);
|
||||
}
|
||||
|
||||
/*
|
||||
if(d<0)
|
||||
{
|
||||
y=t+sl+d;
|
||||
x=t+sl;
|
||||
while(*y++=*x++);
|
||||
}
|
||||
if(d>0)
|
||||
{
|
||||
for(ll=strlen(t);ll>=sl;ll--)
|
||||
t[ll+d]=t[ll];
|
||||
}
|
||||
*/
|
||||
if (d) {
|
||||
// d can be positive or negative, so strcpy cannot be used, use memmove instead
|
||||
// d can be positive or negative, so strcpy cannot be used, using memmove instead
|
||||
(void) memmove(t + sl + d, t + sl, strlen(t) - sl + 1);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user