summaryrefslogtreecommitdiffstats
path: root/libc/stdio/scanf.c
diff options
context:
space:
mode:
author"Steven J. Hill" <sjhill@realitydiluted.com>2005-12-02 01:50:58 +0000
committer"Steven J. Hill" <sjhill@realitydiluted.com>2005-12-02 01:50:58 +0000
commit6fd3ac79613c9e1832513b0f614860be2735993f (patch)
tree5f6bfb750aed249d5951d84de663c03f9e4b82dd /libc/stdio/scanf.c
parent9acef89e60381a298801e4b221d66b1538072b28 (diff)
downloaduClibc-alpine-6fd3ac79613c9e1832513b0f614860be2735993f.tar.bz2
uClibc-alpine-6fd3ac79613c9e1832513b0f614860be2735993f.tar.xz
Merge from trunk.
Diffstat (limited to 'libc/stdio/scanf.c')
-rw-r--r--libc/stdio/scanf.c23
1 files changed, 13 insertions, 10 deletions
diff --git a/libc/stdio/scanf.c b/libc/stdio/scanf.c
index d99896893..1d6522417 100644
--- a/libc/stdio/scanf.c
+++ b/libc/stdio/scanf.c
@@ -43,6 +43,9 @@
* standards and from an official C standard defect report.
*/
+#define wcslen __wcslen
+#define mbsrtowcs __mbsrtowcs
+#define mbrtowc __mbrtowc
#define _ISOC99_SOURCE /* for LLONG_MAX primarily... */
#define _GNU_SOURCE
@@ -247,7 +250,7 @@ int vsscanf(__const char *sp, __const char *fmt, va_list ap)
f.__bufstart =
f.__bufpos = (unsigned char *) ((void *) sp);
f.__bufread =
- f.__bufend = f.__bufstart + strlen(sp);
+ f.__bufend = f.__bufstart + __strlen(sp);
__STDIO_STREAM_ENABLE_GETC(&f);
__STDIO_STREAM_DISABLE_PUTC(&f);
@@ -261,7 +264,7 @@ int vsscanf(__const char *sp, __const char *fmt, va_list ap)
__FILE_vsscanf f;
f.bufpos = (unsigned char *) ((void *) sp);
- f.bufread = f.bufpos + strlen(sp);
+ f.bufread = f.bufpos + __strlen(sp);
/* __STDIO_STREAM_RESET_GCS(&f.f); */
#ifdef __UCLIBC_HAS_GLIBC_CUSTOM_STREAMS__
@@ -303,7 +306,7 @@ int vsscanf(__const char *sp, __const char *fmt, va_list ap)
FILE *f;
int rv = EOF;
- if ((f = fmemopen((char *)sp, strlen(sp), "r")) != NULL) {
+ if ((f = fmemopen((char *)sp, __strlen(sp), "r")) != NULL) {
rv = vfscanf(f, fmt, ap);
fclose(f);
}
@@ -1027,7 +1030,7 @@ static int sc_getc(register struct scan_cookie *sc)
sc->fp->__modeflags |= __FLAG_EOF;
return EOF;
}
- } else if ((wc = fgetwc_unlocked(sc->fp)) == WEOF) {
+ } else if ((wc = __fgetwc_unlocked(sc->fp)) == WEOF) {
return EOF;
}
@@ -1073,7 +1076,7 @@ static int scan_getwc(register struct scan_cookie *sc)
sc->ungot_flag |= 2;
return -1;
}
- } else if ((wc = fgetwc_unlocked(sc->fp)) == WEOF) {
+ } else if ((wc = __fgetwc_unlocked(sc->fp)) == WEOF) {
sc->ungot_flag |= 2;
return -1;
}
@@ -1197,7 +1200,7 @@ int VFSCANF (FILE *__restrict fp, const Wchar *__restrict format, va_list arg)
#if defined(NL_ARGMAX) && (NL_ARGMAX > 0)
psfs.num_pos_args = -1; /* Must start at -1. */
/* Initialize positional arg ptrs to NULL. */
- memset(psfs.pos_args, 0, sizeof(psfs.pos_args));
+ __memset(psfs.pos_args, 0, sizeof(psfs.pos_args));
#endif /* defined(NL_ARGMAX) && (NL_ARGMAX > 0) */
__STDIO_AUTO_THREADLOCK(fp);
@@ -1429,7 +1432,7 @@ int VFSCANF (FILE *__restrict fp, const Wchar *__restrict format, va_list arg)
++fmt;
invert = 1;
}
- memset(scanset, invert, sizeof(scanset));
+ __memset(scanset, invert, sizeof(scanset));
invert = 1-invert;
if (*fmt == ']') {
@@ -1978,14 +1981,14 @@ int attribute_hidden __psfs_do_numeric(psfs_t *psfs, struct scan_cookie *sc)
if ((psfs->conv_num > CONV_i) /* float conversion */
&& (!pass || (i == nblk1)) /* possible last */
- && !memcmp(sc->thousands_sep, sc->fake_decpt, k)
+ && !__memcmp(sc->thousands_sep, sc->fake_decpt, k)
/* and prefix matched, so could be decpt */
) {
__scan_getc(sc);
p = sc->fake_decpt + k;
do {
if (!*++p) {
- strcpy(b, sc->decpt);
+ __strcpy(b, sc->decpt);
b += sc->decpt_len;
goto GOT_DECPT;
}
@@ -2079,7 +2082,7 @@ int attribute_hidden __psfs_do_numeric(psfs_t *psfs, struct scan_cookie *sc)
p = sc->fake_decpt;
do {
if (!*p) {
- strcpy(b, sc->decpt);
+ __strcpy(b, sc->decpt);
b += sc->decpt_len;
break;
}