1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-01 08:27:59 +00:00

add additional function parameter: bufsize_min. it's possible

to check two sizes per one function invocation now.

Suggested by: ache
This commit is contained in:
Alexey Zelkin 2001-02-13 15:29:39 +00:00
parent 107a536955
commit fc38c1e548
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=72442
2 changed files with 7 additions and 4 deletions

View File

@ -45,7 +45,8 @@ __part_load_locale(const char *name,
int* using_locale,
char *locale_buf,
const char *category_name,
int locale_buf_size,
int locale_buf_size_max,
int locale_buf_size_min,
const char **dst_localebuf) {
static char locale_buf_C[] = "C";
@ -118,8 +119,10 @@ __part_load_locale(const char *name,
if (plim[-1] != '\n')
goto bad_lbuf;
num_lines = split_lines(p, plim);
if (num_lines >= locale_buf_size)
num_lines = locale_buf_size;
if (num_lines >= locale_buf_size_max)
num_lines = locale_buf_size_max;
else if (num_lines >= locale_buf_size_min)
num_lines = locale_buf_size_min;
else
goto reset_locale;
set_from_buf(lbuf, num_lines, dst_localebuf);

View File

@ -30,6 +30,6 @@
#define _LDPART_H
extern int __part_load_locale(const char *, int*, char *, const char *,
int, const char **);
int, int, const char **);
#endif /* _LDPART_H */