diff options
author | phantom <phantom@FreeBSD.org> | 2001-02-13 15:29:39 +0000 |
---|---|---|
committer | phantom <phantom@FreeBSD.org> | 2001-02-13 15:29:39 +0000 |
commit | ced7256011bf11eb4b07e931bbfa8d5df18d0f9d (patch) | |
tree | 0fd5d5eece0b7b596b29637975dd02262f4cfe01 /lib | |
parent | ba80a3ed223c9d3392b5b78aa72270d604907d0b (diff) | |
download | FreeBSD-src-ced7256011bf11eb4b07e931bbfa8d5df18d0f9d.zip FreeBSD-src-ced7256011bf11eb4b07e931bbfa8d5df18d0f9d.tar.gz |
add additional function parameter: bufsize_min. it's possible
to check two sizes per one function invocation now.
Suggested by: ache
Diffstat (limited to 'lib')
-rw-r--r-- | lib/libc/locale/ldpart.c | 9 | ||||
-rw-r--r-- | 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 533b253..09ac06e 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 6478d89..b0c8b55 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 */ |