summaryrefslogtreecommitdiff
path: root/funcs
diff options
context:
space:
mode:
authorGeorge Joseph <gjoseph@digium.com>2016-06-28 07:22:24 -0600
committerGeorge Joseph <gjoseph@digium.com>2016-06-28 12:40:49 -0500
commit651290a80902f1ba095f343f0e5c75e61a3ccd7c (patch)
tree6b7b4841dcf0eee73930f2ea17c5e5350dd09e19 /funcs
parent46cc7f114d28e443d48df056c43cbb5f7a197924 (diff)
BuildSystem: Fix a few issues hightlighted by gcc 6.x
gcc 6.1.1 caught a few more issues. Made sure the unit tests still pass for the func_env and stdtime issues. ASTERISK-26157 #close Change-Id: I6664d8f34a45bc1481d2a854481c7878b0c1cf8e
Diffstat (limited to 'funcs')
-rw-r--r--funcs/func_env.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/funcs/func_env.c b/funcs/func_env.c
index 8f9753aaa..3883de601 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) {