From fc38c1e54846972c9f153c104352a981b8b74afc Mon Sep 17 00:00:00 2001 From: Alexey Zelkin Date: Tue, 13 Feb 2001 15:29:39 +0000 Subject: [PATCH] add additional function parameter: bufsize_min. it's possible to check two sizes per one function invocation now. Suggested by: ache --- lib/libc/locale/ldpart.c | 9 ++++++--- lib/libc/locale/ldpart.h | 2 +- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/lib/libc/locale/ldpart.c b/lib/libc/locale/ldpart.c index 533b2534eb5b..09ac06e7f8ec 100644 --- a/lib/libc/locale/ldpart.c +++ b/lib/libc/locale/ldpart.c @@ -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); diff --git a/lib/libc/locale/ldpart.h b/lib/libc/locale/ldpart.h index 6478d8953113..b0c8b55aae2c 100644 --- a/lib/libc/locale/ldpart.h +++ b/lib/libc/locale/ldpart.h @@ -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 */