aboutsummaryrefslogtreecommitdiffstats
path: root/main/say.c
diff options
context:
space:
mode:
authortilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b>2009-10-01 23:53:12 +0000
committertilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b>2009-10-01 23:53:12 +0000
commitfd899f06543c87b9e8acc50faff01a5818cbc6b5 (patch)
tree3ebe9235f95a3e5f80ee3969797e81aa3ee5468e /main/say.c
parent98207b7cdc24e4951fd6fe5e328c5f810033f9ee (diff)
Fix a bunch of off-by-one errors
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@221776 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'main/say.c')
-rw-r--r--main/say.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/main/say.c b/main/say.c
index 439855bf4..507c3c3e2 100644
--- a/main/say.c
+++ b/main/say.c
@@ -3254,7 +3254,7 @@ int ast_say_date_with_format_en(struct ast_channel *chan, time_t time, const cha
case '\'':
/* Literal name of a sound file */
sndoffset=0;
- for (sndoffset=0 ; (format[++offset] != '\'') && (sndoffset < 256) ; sndoffset++)
+ for (sndoffset=0 ; (format[++offset] != '\'') && (sndoffset < sizeof(sndfile) - 1) ; sndoffset++)
sndfile[sndoffset] = format[offset];
sndfile[sndoffset] = '\0';
res = wait_file(chan,ints,sndfile,lang);
@@ -3502,7 +3502,7 @@ int ast_say_date_with_format_da(struct ast_channel *chan, time_t time, const cha
case '\'':
/* Literal name of a sound file */
sndoffset=0;
- for (sndoffset=0 ; (format[++offset] != '\'') && (sndoffset < 256) ; sndoffset++)
+ for (sndoffset=0 ; (format[++offset] != '\'') && (sndoffset < sizeof(sndfile) - 1) ; sndoffset++)
sndfile[sndoffset] = format[offset];
sndfile[sndoffset] = '\0';
res = wait_file(chan,ints,sndfile,lang);
@@ -3707,7 +3707,7 @@ int ast_say_date_with_format_de(struct ast_channel *chan, time_t time, const cha
case '\'':
/* Literal name of a sound file */
sndoffset=0;
- for (sndoffset=0 ; (format[++offset] != '\'') && (sndoffset < 256) ; sndoffset++)
+ for (sndoffset=0 ; (format[++offset] != '\'') && (sndoffset < sizeof(sndfile) - 1) ; sndoffset++)
sndfile[sndoffset] = format[offset];
sndfile[sndoffset] = '\0';
res = wait_file(chan,ints,sndfile,lang);
@@ -3939,7 +3939,7 @@ int ast_say_date_with_format_he(struct ast_channel *chan, time_t time, const cha
case '\'':
/* Literal name of a sound file */
sndoffset=0;
- for (sndoffset=0 ; (format[++offset] != '\'') && (sndoffset < 256) ; sndoffset++)
+ for (sndoffset=0 ; (format[++offset] != '\'') && (sndoffset < sizeof(sndfile) - 1) ; sndoffset++)
sndfile[sndoffset] = format[offset];
sndfile[sndoffset] = '\0';
res = wait_file(chan,ints,sndfile,lang);
@@ -4094,7 +4094,7 @@ int ast_say_date_with_format_es(struct ast_channel *chan, time_t time, const cha
case '\'':
/* Literal name of a sound file */
sndoffset=0;
- for (sndoffset=0 ; (format[++offset] != '\'') && (sndoffset < 256) ; sndoffset++)
+ for (sndoffset=0 ; (format[++offset] != '\'') && (sndoffset < sizeof(sndfile) - 1) ; sndoffset++)
sndfile[sndoffset] = format[offset];
sndfile[sndoffset] = '\0';
snprintf(nextmsg,sizeof(nextmsg), "%s", sndfile);
@@ -4286,7 +4286,7 @@ int ast_say_date_with_format_fr(struct ast_channel *chan, time_t time, const cha
case '\'':
/* Literal name of a sound file */
sndoffset=0;
- for (sndoffset=0 ; (format[++offset] != '\'') && (sndoffset < 256) ; sndoffset++)
+ for (sndoffset=0 ; (format[++offset] != '\'') && (sndoffset < sizeof(sndfile) - 1) ; sndoffset++)
sndfile[sndoffset] = format[offset];
sndfile[sndoffset] = '\0';
res = wait_file(chan,ints,sndfile,lang);
@@ -4484,7 +4484,7 @@ int ast_say_date_with_format_it(struct ast_channel *chan, time_t time, const cha
case '\'':
/* Literal name of a sound file */
sndoffset=0;
- for (sndoffset=0 ; (format[++offset] != '\'') && (sndoffset < 256) ; sndoffset++)
+ for (sndoffset=0 ; (format[++offset] != '\'') && (sndoffset < sizeof(sndfile) - 1) ; sndoffset++)
sndfile[sndoffset] = format[offset];
sndfile[sndoffset] = '\0';
res = wait_file(chan,ints,sndfile,lang);
@@ -4717,7 +4717,7 @@ int ast_say_date_with_format_nl(struct ast_channel *chan, time_t time, const cha
case '\'':
/* Literal name of a sound file */
sndoffset=0;
- for (sndoffset=0 ; (format[++offset] != '\'') && (sndoffset < 256) ; sndoffset++)
+ for (sndoffset=0 ; (format[++offset] != '\'') && (sndoffset < sizeof(sndfile) - 1) ; sndoffset++)
sndfile[sndoffset] = format[offset];
sndfile[sndoffset] = '\0';
res = wait_file(chan,ints,sndfile,lang);
@@ -4923,7 +4923,7 @@ int ast_say_date_with_format_pl(struct ast_channel *chan, time_t thetime, const
case '\'':
/* Literal name of a sound file */
sndoffset = 0;
- for (sndoffset = 0 ; (format[++offset] != '\'') && (sndoffset < 256) ; sndoffset++)
+ for (sndoffset = 0 ; (format[++offset] != '\'') && (sndoffset < sizeof(sndfile) - 1) ; sndoffset++)
sndfile[sndoffset] = format[offset];
sndfile[sndoffset] = '\0';
res = wait_file(chan, ints, sndfile, lang);
@@ -5141,7 +5141,7 @@ int ast_say_date_with_format_pt(struct ast_channel *chan, time_t time, const cha
case '\'':
/* Literal name of a sound file */
sndoffset=0;
- for (sndoffset=0 ; (format[++offset] != '\'') && (sndoffset < 256) ; sndoffset++)
+ for (sndoffset=0 ; (format[++offset] != '\'') && (sndoffset < sizeof(sndfile) - 1) ; sndoffset++)
sndfile[sndoffset] = format[offset];
sndfile[sndoffset] = '\0';
snprintf(nextmsg,sizeof(nextmsg), "%s", sndfile);
@@ -5431,7 +5431,7 @@ int ast_say_date_with_format_zh(struct ast_channel *chan, time_t time, const cha
case '\'':
/* Literal name of a sound file */
sndoffset=0;
- for (sndoffset=0 ; (format[++offset] != '\'') && (sndoffset < 256) ; sndoffset++)
+ for (sndoffset=0 ; (format[++offset] != '\'') && (sndoffset < sizeof(sndfile) - 1) ; sndoffset++)
sndfile[sndoffset] = format[offset];
sndfile[sndoffset] = '\0';
res = wait_file(chan,ints,sndfile,lang);
@@ -6808,7 +6808,7 @@ static int ast_say_date_with_format_gr(struct ast_channel *chan, time_t time, co
case '\'':
/* Literal name of a sound file */
sndoffset=0;
- for (sndoffset=0 ; (format[++offset] != '\'') && (sndoffset < 256) ; sndoffset++)
+ for (sndoffset=0 ; (format[++offset] != '\'') && (sndoffset < sizeof(sndfile) - 1) ; sndoffset++)
sndfile[sndoffset] = format[offset];
sndfile[sndoffset] = '\0';
res = wait_file(chan,ints,sndfile,lang);