Lines 184-189
static char *GetLTXToken(char *Src, char
Link Here
|
184 |
#define GET_TOKEN 256 |
184 |
#define GET_TOKEN 256 |
185 |
#define GET_STRIP_TOKEN 257 |
185 |
#define GET_STRIP_TOKEN 257 |
186 |
|
186 |
|
|
|
187 |
static void ShiftLeftOne(char *Buf) |
188 |
{ |
189 |
char *P; |
190 |
|
191 |
if (*Buf) |
192 |
{ |
193 |
for (P = Buf + 1; *P; ++P) |
194 |
*(P - 1) = *P; |
195 |
*(P - 1) = '\0'; |
196 |
} |
197 |
} |
198 |
|
187 |
static char *GetLTXArg(char *SrcBuf, char *OrigDest, const int Until, |
199 |
static char *GetLTXArg(char *SrcBuf, char *OrigDest, const int Until, |
188 |
struct WordList *wl) |
200 |
struct WordList *wl) |
189 |
{ |
201 |
{ |
Lines 218-224
static char *GetLTXArg(char *SrcBuf, cha
Link Here
|
218 |
|
230 |
|
219 |
if (Retval && (*OrigDest == '{') && (Until == GET_STRIP_TOKEN)) |
231 |
if (Retval && (*OrigDest == '{') && (Until == GET_STRIP_TOKEN)) |
220 |
{ |
232 |
{ |
221 |
strcpy(OrigDest, OrigDest + 1); |
233 |
/* According to strcpy(3): The strings may not overlap |
|
|
234 |
So the following call: |
235 |
|
236 |
strcpy(OrigDest, OrigDest + 1); |
237 |
|
238 |
is undefined, and it DOES produce errors in new versions |
239 |
of glibc (checked on glibc-2.12.2). |
240 |
|
241 |
Call safe version. */ |
242 |
ShiftLeftOne(OrigDest); |
222 |
OrigDest[strlen(OrigDest) - 1] = 0; |
243 |
OrigDest[strlen(OrigDest) - 1] = 0; |
223 |
} |
244 |
} |
224 |
break; |
245 |
break; |