diff options
Diffstat (limited to 'funcs/func_env.c')
-rw-r--r-- | funcs/func_env.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/funcs/func_env.c b/funcs/func_env.c index 3c260a2fb..072714f19 100644 --- a/funcs/func_env.c +++ b/funcs/func_env.c @@ -624,7 +624,7 @@ static int file_read(struct ast_channel *chan, const char *cmd, char *data, stru ast_log(LOG_ERROR, "Cannot seek to offset %" PRId64 ": %s\n", i, strerror(errno)); } end = fread(fbuf, 1, sizeof(fbuf), ff); - for (pos = (end < sizeof(fbuf) ? fbuf + end - 1 : fbuf + sizeof(fbuf) - 1); pos > fbuf - 1; pos--) { + for (pos = (end < sizeof(fbuf) ? fbuf + end - 1 : fbuf + sizeof(fbuf) - 1); pos >= fbuf; pos--) { LINE_COUNTER(pos, format, count); if (length < 0 && count * -1 == length) { @@ -1024,7 +1024,7 @@ static int file_write(struct ast_channel *chan, const char *cmd, char *data, con fclose(ff); return -1; } - for (pos = fbuf + sizeof(fbuf) - 1; pos > fbuf - 1; pos--) { + for (pos = fbuf + sizeof(fbuf) - 1; pos >= fbuf; pos--) { LINE_COUNTER(pos, newline_format, count); if (length < 0 && count * -1 == length) { |