1
0
mirror of https://git.FreeBSD.org/src.git synced 2025-01-03 12:35:02 +00:00

Deal properly with "0"

This commit is contained in:
Andrey A. Chernov 2001-02-19 06:19:51 +00:00
parent 9fc8e61304
commit c80a91609d
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=72686

View File

@ -68,7 +68,11 @@ __fix_locale_grouping_str(const char *str) {
n += *src - '0';
}
*dst++ = n;
*dst = n;
/* NOTE: assume all input started with "0" as 'no grouping' */
if (*dst == '\0')
return (dst == (char*)str) ? nogrouping : str;
dst++;
}
*dst = '\0';
return str;