aboutsummaryrefslogtreecommitdiff
path: root/posix/wordexp.c
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2007-01-22 21:21:52 +0000
committerUlrich Drepper <drepper@redhat.com>2007-01-22 21:21:52 +0000
commit765bbb24bd0bc5da4e183b1f6f43196da0126ffb (patch)
tree4b2950da43a7d6c3dcf3d2be97431e7e3b102e54 /posix/wordexp.c
parent6cae39579b699d09b94a315483a9ac804b56fe34 (diff)
downloadglibc-765bbb24bd0bc5da4e183b1f6f43196da0126ffb.tar
glibc-765bbb24bd0bc5da4e183b1f6f43196da0126ffb.tar.gz
glibc-765bbb24bd0bc5da4e183b1f6f43196da0126ffb.tar.bz2
glibc-765bbb24bd0bc5da4e183b1f6f43196da0126ffb.zip
* stdio-common/_itowa.c: Don't compile _itowa for 64-bit
platforms. * stdio-common/_itoa.c: Don't compile in _itoa and _fitoa for 64-bit platforms. * malloc/mtrace.c (tr_where): Use _fitoa_word instead of _fitoa if possible. * posix/wordexp.c (parse_arith): Use _itoa_word instead of _itoa if possible.
Diffstat (limited to 'posix/wordexp.c')
-rw-r--r--posix/wordexp.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/posix/wordexp.c b/posix/wordexp.c
index 765d14d81f..40d1b6a7db 100644
--- a/posix/wordexp.c
+++ b/posix/wordexp.c
@@ -1,5 +1,5 @@
/* POSIX.2 wordexp implementation.
- Copyright (C) 1997-2002, 2003, 2005, 2006 Free Software Foundation, Inc.
+ Copyright (C) 1997-2003, 2005, 2006, 2007 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Tim Waugh <tim@cyberelk.demon.co.uk>.
@@ -25,6 +25,7 @@
#include <fnmatch.h>
#include <glob.h>
#include <libintl.h>
+#include <limits.h>
#include <paths.h>
#include <pwd.h>
#include <signal.h>
@@ -757,8 +758,13 @@ parse_arith (char **word, size_t *word_length, size_t *max_length,
convertme = numresult;
result[20] = '\0';
- *word = w_addstr (*word, word_length, max_length,
- _itoa (convertme, &result[20], 10, 0));
+ char *numstr;
+#if LLONG_MAX == LONG_MAX
+ numstr = _itoa_word (convertme, &result[20], 10, 0);
+#else
+ numstr = _itoa (convertme, &result[20], 10, 0);
+#endif
+ *word = w_addstr (*word, word_length, max_length, numstr);
free (expr);
return *word ? 0 : WRDE_NOSPACE;
}