}
static int main_change_folder(struct Menu *menu, int op, char *buf,
- size_t bufsz, int *oldcount, int *index_hint)
+ size_t buflen, int *oldcount, int *index_hint)
{
#ifdef USE_NNTP
if (OPT_NEWS)
{
OPT_NEWS = false;
- nntp_expand_path(buf, bufsz, &CurrentNewsSrv->conn->account);
+ nntp_expand_path(buf, buflen, &CurrentNewsSrv->conn->account);
}
else
#endif
- mutt_expand_path(buf, bufsz);
+ mutt_expand_path(buf, buflen);
if (mx_get_magic(buf) <= 0)
{
mutt_error(_("%s is not a mailbox."), buf);
return (h && h->data) ? ((struct NmHdrData *) h->data)->virtual_id : NULL;
}
-static char *header_get_fullpath(struct Header *h, char *buf, size_t bufsz)
+static char *header_get_fullpath(struct Header *h, char *buf, size_t buflen)
{
- snprintf(buf, bufsz, "%s/%s", nm_header_get_folder(h), h->path);
+ snprintf(buf, buflen, "%s/%s", nm_header_get_folder(h), h->path);
return buf;
}
* windowed_query_from_query - transforms a vfolder search query into a windowed one
* @param[in] query vfolder search string
* @param[out] buf allocated string buffer to receive the modified search query
- * @param[in] bufsz allocated maximum size of the buf string buffer
+ * @param[in] buflen allocated maximum size of the buf string buffer
* @retval true Transformed search query is available as a string in buf
* @retval false Search query shall not be transformed
*
* If there's no search registered in `nm_query_window_current_search` or this is
* a new search, it will reset the window and do the search.
*/
-static bool windowed_query_from_query(const char *query, char *buf, size_t bufsz)
+static bool windowed_query_from_query(const char *query, char *buf, size_t buflen)
{
mutt_debug(2, "nm: %s\n", query);
}
if (end == 0)
- snprintf(buf, bufsz, "date:%d%s..now and %s", beg, NmQueryWindowTimebase,
+ snprintf(buf, buflen, "date:%d%s..now and %s", beg, NmQueryWindowTimebase,
NmQueryWindowCurrentSearch);
else
- snprintf(buf, bufsz, "date:%d%s..%d%s and %s", beg, NmQueryWindowTimebase,
+ snprintf(buf, buflen, "date:%d%s..%d%s and %s", beg, NmQueryWindowTimebase,
end, NmQueryWindowTimebase, NmQueryWindowCurrentSearch);
mutt_debug(2, "nm: %s -> %s\n", query, buf);
return rc;
}
-char *nm_uri_from_query(struct Context *ctx, char *buf, size_t bufsz)
+char *nm_uri_from_query(struct Context *ctx, char *buf, size_t buflen)
{
mutt_debug(2, "(%s)\n", buf);
struct NmCtxData *data = get_ctxdata(ctx);
url_pct_encode(&uri[added], sizeof(uri) - added, buf);
- strncpy(buf, uri, bufsz);
- buf[bufsz - 1] = '\0';
+ strncpy(buf, uri, buflen);
+ buf[buflen - 1] = '\0';
mutt_debug(1, "nm: uri from query '%s'\n", buf);
return buf;
return NULL;
}
-int nm_description_to_path(const char *desc, char *buf, size_t bufsz)
+int nm_description_to_path(const char *desc, char *buf, size_t buflen)
{
- if (!desc || !buf || !bufsz)
+ if (!desc || !buf || (buflen == 0))
return -EINVAL;
for (struct Buffy *b = Incoming; b; b = b->next)
{
if ((b->magic == MUTT_NOTMUCH) && b->desc && (strcmp(desc, b->desc) == 0))
{
- strncpy(buf, b->path, bufsz);
- buf[bufsz - 1] = '\0';
+ strncpy(buf, b->path, buflen);
+ buf[buflen - 1] = '\0';
return 0;
}
}
char *nm_header_get_folder(struct Header *h);
int nm_update_filename(struct Context *ctx, const char *old, const char *new, struct Header *h);
bool nm_normalize_uri(char *new_uri, const char *orig_uri, size_t new_uri_sz);
-char *nm_uri_from_query(struct Context *ctx, char *buf, size_t bufsz);
+char *nm_uri_from_query(struct Context *ctx, char *buf, size_t buflen);
bool nm_message_is_still_queried(struct Context *ctx, struct Header *hdr);
void nm_query_window_backward(void);
void nm_longrun_done(struct Context *ctx);
char *nm_get_description(struct Context *ctx);
-int nm_description_to_path(const char *desc, char *buf, size_t bufsz);
+int nm_description_to_path(const char *desc, char *buf, size_t buflen);
int nm_record_message(struct Context *ctx, char *path, struct Header *h);