Use __XSTRING(CHAR_MAX) instead of "127" and strtol() base 0 to parse it (0x7f)

This commit is contained in:
Andrey A. Chernov 2001-02-10 02:00:56 +00:00
parent 1506a668dc
commit d2712eafa7
3 changed files with 7 additions and 3 deletions

View File

@ -26,6 +26,8 @@
* $FreeBSD$
*/
#include <limits.h>
#include <sys/cdefs.h>
#include "lmonetary.h"
#include "ldpart.h"
@ -34,7 +36,7 @@ extern int __mlocale_changed;
#define LCMONETARY_SIZE (sizeof(struct lc_monetary_T) / sizeof(char *))
static char empty[] = "";
static char numempty[] = "127"; /* XXX: CHAR_MAX supposed here */
static char numempty[] = __XSTRING(CHAR_MAX);
static const struct lc_monetary_T _C_monetary_locale = {
empty , /* int_curr_symbol */

View File

@ -26,6 +26,8 @@
* $FreeBSD$
*/
#include <limits.h>
#include <sys/cdefs.h>
#include "lnumeric.h"
#include "ldpart.h"
@ -33,7 +35,7 @@ extern int __nlocale_changed;
#define LCNUMERIC_SIZE (sizeof(struct lc_numeric_T) / sizeof(char *))
static char numempty[] = "127"; /* XXX: CHAR_MAX supposed here */
static char numempty[] = __XSTRING(CHAR_MAX);
static const struct lc_numeric_T _C_numeric_locale = {
".", /* decimal_point */

View File

@ -51,7 +51,7 @@ int __nlocale_changed = 1;
static char
cnv(char *str) {
return (char)strtol(str, NULL, 10);
return (char)strtol(str, NULL, 0);
}
/*