version 1.78, 2023/09/20 16:49:13 |
version 1.79, 2023/10/06 22:29:24 |
|
|
fa *pfa; |
fa *pfa; |
int mflag, tempstat, num; |
int mflag, tempstat, num; |
int bufsz = recsize; |
int bufsz = recsize; |
|
int charlen = 0; |
|
|
if ((buf = (char *) malloc(bufsz)) == NULL) |
if ((buf = (char *) malloc(bufsz)) == NULL) |
FATAL("out of memory in gsub"); |
FATAL("out of memory in gsub"); |
|
|
if (*t == '\0') /* at end */ |
if (*t == '\0') /* at end */ |
goto done; |
goto done; |
adjbuf(&buf, &bufsz, 2+pb-buf, recsize, &pb, "gsub"); |
adjbuf(&buf, &bufsz, 2+pb-buf, recsize, &pb, "gsub"); |
*pb++ = *t++; |
charlen = u8_nextlen(t); |
|
while (charlen-- > 0) |
|
*pb++ = *t++; |
if (pb > buf + bufsz) /* BUG: not sure of this test */ |
if (pb > buf + bufsz) /* BUG: not sure of this test */ |
FATAL("gsub result0 %.30s too big; can't happen", buf); |
FATAL("gsub result0 %.30s too big; can't happen", buf); |
mflag = 0; |
mflag = 0; |