* src/progress.c (count_cols): Fix return value if USE_NLS_PROGRESS_BAR is undefined

Taking patch from #54126
Reported-by: Vyacheslav
Copyright-paperwork-exempt: Yes
This commit is contained in:
Tim Rühsen 2019-12-16 12:26:24 +01:00
parent ce8ce5bfc0
commit 042f2727bf

View File

@ -861,10 +861,12 @@ cols_to_bytes (const char *mbs, const int cols, int *ncols)
#else #else
static int count_cols (const char *mbs) { return (int) strlen(mbs); } static int count_cols (const char *mbs) { return (int) strlen(mbs); }
static int static int
cols_to_bytes (const char *mbs _GL_UNUSED, const int cols, int *ncols) cols_to_bytes (const char *mbs, const int cols, int *ncols)
{ {
*ncols = cols; int len = strlen(mbs);
return cols; int ret = len < cols ? len : cols;
*ncols = ret;
return ret;
} }
#endif #endif