A bit more boundary-checking when replacing variables.
Makes valgrind happy
This commit is contained in:
parent
e1949aa694
commit
cd6c3fedcb
|
@ -390,6 +390,7 @@ void parse_file(const char *f) {
|
||||||
int extra = (strlen(current->value) - strlen(current->key));
|
int extra = (strlen(current->value) - strlen(current->key));
|
||||||
char *next;
|
char *next;
|
||||||
for (next = bufcopy;
|
for (next = bufcopy;
|
||||||
|
(bufcopy + (next - bufcopy)) < (buf + stbuf.st_size) &&
|
||||||
(next = strcasestr(bufcopy + (next - bufcopy), current->key)) != NULL;
|
(next = strcasestr(bufcopy + (next - bufcopy), current->key)) != NULL;
|
||||||
next += strlen(current->key)) {
|
next += strlen(current->key)) {
|
||||||
*next = '_';
|
*next = '_';
|
||||||
|
|
Loading…
Reference in New Issue