From 2695b63fbe6c6a2206a2637137c6cd654f69943a Mon Sep 17 00:00:00 2001 From: Eduardo Chappa Date: Sun, 26 Jul 2015 23:36:30 -0600 Subject: * Clear even more warnings from clang 3.5 and MAC OSX. --- pico/attach.c | 6 +++--- pico/browse.c | 2 +- pico/file.c | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) (limited to 'pico') diff --git a/pico/attach.c b/pico/attach.c index be4a9fbf..3a702729 100644 --- a/pico/attach.c +++ b/pico/attach.c @@ -170,7 +170,7 @@ AskAttach(char *cmnt, size_t cmntlen, LMLIST **lm) ? "." : ((gmode & MDTREE) || opertree[0]) ? opertree : gethomedir(NULL), - C_FILESEP, p - fn, fn); + C_FILESEP, (int) (p - fn), fn); } else{ fname = fn; @@ -1069,8 +1069,8 @@ process_tag: /* enclosed in [] */ * whole attachment, comment or done! */ if(c == ',' || c == '\0' || c == '\"'){ - strncpy(sz, (lblsz) ? lblsz : prettysz(attsz), sizeof(sz)); - sz[sizeof(sz)-1] = '\0'; + strncpy(sz, (lblsz) ? lblsz : prettysz(attsz), szlen); + sz[szlen-1] = '\0'; snprintf(ctmp, sizeof(ctmp), " (%s) %s", sz, (c == '\"') ? "" : "\"\""); u = utf8_to_ucs4_cpystr(ctmp); diff --git a/pico/browse.c b/pico/browse.c index 79940109..11d3eb3f 100644 --- a/pico/browse.c +++ b/pico/browse.c @@ -1482,7 +1482,7 @@ FileBrowse(char *dir, size_t dirlen, char *fn, size_t fnlen, tmp[sizeof(tmp)-1] = '\0'; } - strncat(tmp, gmp->current->fname, sizeof(tmp)-strlen(tmp)); + strncat(tmp, gmp->current->fname, sizeof(tmp)-strlen(tmp)-1); tmp[sizeof(tmp)-1] = '\0'; } diff --git a/pico/file.c b/pico/file.c index 405d2c6f..29f16804 100644 --- a/pico/file.c +++ b/pico/file.c @@ -408,7 +408,7 @@ file_split(char *dirbuf, size_t dirbuflen, char *orig_fname, int is_for_browse) ? opertree : ((is_for_browse && browse_dir[0]) ? browse_dir : gethomedir(NULL)), - C_FILESEP, p - orig_fname, orig_fname); + C_FILESEP, (int) (p - orig_fname), orig_fname); } else{ fn = orig_fname; @@ -645,7 +645,7 @@ filewrite(int f, int n) ? "." : ((gmode & MDTREE) || opertree[0]) ? opertree : gethomedir(NULL), - C_FILESEP, p - fname, fname); + C_FILESEP, (int) (p - fname), fname); } else{ fn = fname; -- cgit v1.2.3-70-g09d2