From: Richard Russon Date: Mon, 1 Jan 2018 18:04:06 +0000 (+0000) Subject: rename parameters bufsz -> buflen X-Git-Tag: neomutt-20180223~43^2~6 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=a22061a5173d910334b78e3236c482d3743fb5ac;p=neomutt rename parameters bufsz -> buflen --- diff --git a/curs_main.c b/curs_main.c index 375f0e79a..af2d00065 100644 --- a/curs_main.c +++ b/curs_main.c @@ -434,17 +434,17 @@ void update_index(struct Menu *menu, struct Context *ctx, int check, int oldcoun } 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); diff --git a/mutt_notmuch.c b/mutt_notmuch.c index ad8950d5a..e3d995fad 100644 --- a/mutt_notmuch.c +++ b/mutt_notmuch.c @@ -237,9 +237,9 @@ static char *header_get_id(struct Header *h) 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; } @@ -308,7 +308,7 @@ static void query_window_reset(void) * 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 * @@ -342,7 +342,7 @@ static void query_window_reset(void) * 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); @@ -369,10 +369,10 @@ static bool windowed_query_from_query(const char *query, char *buf, size_t bufsz } 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); @@ -1584,7 +1584,7 @@ done: 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); @@ -1623,8 +1623,8 @@ char *nm_uri_from_query(struct Context *ctx, char *buf, size_t bufsz) 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; @@ -1950,17 +1950,17 @@ char *nm_get_description(struct Context *ctx) 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; } } diff --git a/mutt_notmuch.h b/mutt_notmuch.h index bbbe8d432..424fc35e6 100644 --- a/mutt_notmuch.h +++ b/mutt_notmuch.h @@ -35,7 +35,7 @@ int nm_read_entire_thread(struct Context *ctx, struct Header *h); 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); @@ -45,7 +45,7 @@ void nm_longrun_init(struct Context *ctx, bool writable); 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);