mirror of
https://github.com/fachat/xa65.git
synced 2024-07-01 11:29:35 +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
|
#endif
|
||||||
}
|
}
|
||||||
/* if(flag) printf("sl=%d,",sl);*/
|
/* 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);*/
|
/* if(flag) printf("sl=%d\n",sl);*/
|
||||||
rs = fto;
|
rs = fto;
|
||||||
#ifdef DEBUG_RECMAC
|
#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);
|
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) {
|
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);
|
(void) memmove(t + sl + d, t + sl, strlen(t) - sl + 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user