]> granicus.if.org Git - neomutt/commitdiff
buf,buflen
authorRichard Russon <rich@flatcap.org>
Wed, 18 Jul 2018 22:19:28 +0000 (23:19 +0100)
committerRichard Russon <rich@flatcap.org>
Thu, 19 Jul 2018 09:56:47 +0000 (10:56 +0100)
muttlib.c
pager.c

index 84d07cc72e3d044931ec8a025cb487b85b2fce2e..28e832c155dfe1a8482bfb42889637a6b4be3aa0 100644 (file)
--- a/muttlib.c
+++ b/muttlib.c
@@ -73,27 +73,27 @@ static const char *xdg_defaults[] = {
 
 /**
  * mutt_adv_mktemp - Advanced mktemp(3)
- * @param s Buffer for result
- * @param l Length of buffer
+ * @param buf    Buffer for result
+ * @param buflen Length of buffer
  *
  * Modified by blong to accept a "suggestion" for file name.  If that file
  * exists, then construct one with unique name but keep any extension.  This
  * might fail, I guess.
  */
-void mutt_adv_mktemp(char *s, size_t l)
+void mutt_adv_mktemp(char *buf, size_t buflen)
 {
-  if (s[0] == '\0')
+  if (buf[0] == '\0')
   {
-    mutt_mktemp(s, l);
+    mutt_mktemp(buf, buflen);
   }
   else
   {
     char prefix[PATH_MAX];
-    mutt_str_strfcpy(prefix, s, sizeof(prefix));
+    mutt_str_strfcpy(prefix, buf, sizeof(prefix));
     mutt_file_sanitize_filename(prefix, true);
-    snprintf(s, l, "%s/%s", NONULL(Tmpdir), prefix);
+    snprintf(buf, buflen, "%s/%s", NONULL(Tmpdir), prefix);
     struct stat sb;
-    if (lstat(s, &sb) == -1 && errno == ENOENT)
+    if (lstat(buf, &sb) == -1 && errno == ENOENT)
       return;
 
     char *suffix = strrchr(prefix, '.');
@@ -102,7 +102,7 @@ void mutt_adv_mktemp(char *s, size_t l)
       *suffix = 0;
       suffix++;
     }
-    mutt_mktemp_pfx_sfx(s, l, prefix, suffix);
+    mutt_mktemp_pfx_sfx(buf, buflen, prefix, suffix);
   }
 }
 
diff --git a/pager.c b/pager.c
index ead6aa22c67aba9d53c912aaa4edfa74b682a967..c7ba57057bf3337dadf3581ef87de662871cfa11 100644 (file)
--- a/pager.c
+++ b/pager.c
@@ -1147,21 +1147,21 @@ static int grok_ansi(unsigned char *buf, int pos, struct AnsiAttr *a)
 
 /**
  * trim_incomplete_mbyte - Remove an incomplete character
- * @param buf Buffer containing string
- * @param len Length of buffer
+ * @param buf    Buffer containing string
+ * @param buflen Length of buffer
  * @retval num Number of bytes remaining
  *
  * trim tail of buf so that it contains complete multibyte characters
  */
-static int trim_incomplete_mbyte(unsigned char *buf, size_t len)
+static int trim_incomplete_mbyte(unsigned char *buf, size_t buflen)
 {
   mbstate_t mbstate;
   size_t k;
 
   memset(&mbstate, 0, sizeof(mbstate));
-  for (; len > 0; buf += k, len -= k)
+  for (; buflen > 0; buf += k, buflen -= k)
   {
-    k = mbrtowc(NULL, (char *) buf, len, &mbstate);
+    k = mbrtowc(NULL, (char *) buf, buflen, &mbstate);
     if (k == (size_t)(-2))
       break;
     else if (k == (size_t)(-1) || k == 0)
@@ -1173,7 +1173,7 @@ static int trim_incomplete_mbyte(unsigned char *buf, size_t len)
   }
   *buf = '\0';
 
-  return len;
+  return buflen;
 }
 
 static int fill_buffer(FILE *f, LOFF_T *last_pos, LOFF_T offset, unsigned char **buf,