summaryrefslogtreecommitdiff
path: root/alpine/osdep
diff options
context:
space:
mode:
authorEduardo Chappa <chappa@washington.edu>2015-07-26 23:36:30 -0600
committerEduardo Chappa <chappa@washington.edu>2015-07-26 23:36:30 -0600
commit2695b63fbe6c6a2206a2637137c6cd654f69943a (patch)
tree717008efdac9ae66bf33985dc99ee68aea45bf11 /alpine/osdep
parent36b77661542a63c4579943951d143c8cc9c99460 (diff)
downloadalpine-2695b63fbe6c6a2206a2637137c6cd654f69943a.tar.xz
* Clear even more warnings from clang 3.5 and MAC OSX.
Diffstat (limited to 'alpine/osdep')
-rw-r--r--alpine/osdep/debuging.c10
-rw-r--r--alpine/osdep/fltrname.c7
2 files changed, 9 insertions, 8 deletions
diff --git a/alpine/osdep/debuging.c b/alpine/osdep/debuging.c
index 55cbc9b9..4f115fe9 100644
--- a/alpine/osdep/debuging.c
+++ b/alpine/osdep/debuging.c
@@ -397,13 +397,13 @@ dump_config(struct pine *ps, gf_io_t pc, int brief)
(i == 3) ? vars->post_user_val.l :
(i == 4) ? vars->global_val.l
: vars->fixed_val.l;
- if(t && *t){
+ if(t && *t){ /* MAILTMPLEN = sizeof(tmp) */
snprintf(tmp, sizeof(tmp), " %20.20s : %.*s\n", vars->name,
- sizeof(tmp)-26, **t ? *t : quotes);
+ MAILTMPLEN-26, **t ? *t : quotes);
gf_puts(tmp, pc);
while(++t && *t){
snprintf(tmp, sizeof(tmp)," %20.20s : %.*s\n","",
- sizeof(tmp)-26, **t ? *t : quotes);
+ MAILTMPLEN-26, **t ? *t : quotes);
gf_puts(tmp, pc);
}
}
@@ -416,9 +416,9 @@ dump_config(struct pine *ps, gf_io_t pc, int brief)
(i == 3) ? vars->post_user_val.p :
(i == 4) ? vars->global_val.p
: vars->fixed_val.p;
- if(t){
+ if(t){ /* MAILTMPLEN = sizeof(tmp) */
snprintf(tmp, sizeof(tmp), " %20.20s : %.*s\n", vars->name,
- sizeof(tmp)-26, *t ? t : quotes);
+ MAILTMPLEN-26, *t ? t : quotes);
gf_puts(tmp, pc);
}
}
diff --git a/alpine/osdep/fltrname.c b/alpine/osdep/fltrname.c
index e9a6c40b..f601c067 100644
--- a/alpine/osdep/fltrname.c
+++ b/alpine/osdep/fltrname.c
@@ -39,6 +39,7 @@ static char rcsid[] = "$Id: fltrname.c 769 2007-10-24 00:15:40Z hubert@u.washing
char *
filter_filename(char *file, int *fatal, int strict)
{
+#define ERRORLEN 100
#define ALLOW_WEIRD 1
#ifdef ALLOW_WEIRD
static char illegal[] = {'\177', '\0'};
@@ -53,7 +54,7 @@ filter_filename(char *file, int *fatal, int strict)
'\\', '^', '|', '\177', '\0'};
#endif /* UNIX */
#endif
- static char error[100];
+ static char error[ERRORLEN];
char ill_file[MAXPATH+1], *ill_char, *ptr, e2[20];
int i;
@@ -91,7 +92,7 @@ filter_filename(char *file, int *fatal, int strict)
ill_file[MIN(ptr-file,sizeof(ill_file)-1)] = '\0';
snprintf(error, sizeof(error),
"Character \"%s\" after \"%.*s\" not allowed in file name",
- ill_char, sizeof(error)-50, ill_file);
+ ill_char, ERRORLEN-50, ill_file);
} else {
snprintf(error, sizeof(error),
"First character, \"%s\", not allowed in file name",
@@ -102,7 +103,7 @@ filter_filename(char *file, int *fatal, int strict)
}
if((i=is_writable_dir(file)) == 0 || i == 1){
- snprintf(error, sizeof(error), "\"%.*s\" is a directory", sizeof(error)-50, file);
+ snprintf(error, sizeof(error), "\"%.*s\" is a directory", ERRORLEN-50, file);
return(error);
}